<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Zdeněk Topič on Medium]]></title>
        <description><![CDATA[Stories by Zdeněk Topič on Medium]]></description>
        <link>https://medium.com/@zdnkt?source=rss-6d5af3297cb1------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*LvTTg2_gv6Lg8Dhh0prXuw.jpeg</url>
            <title>Stories by Zdeněk Topič on Medium</title>
            <link>https://medium.com/@zdnkt?source=rss-6d5af3297cb1------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 09:06:02 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@zdnkt/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Swift Tip: Initializing & configuring properties]]></title>
            <link>https://medium.com/@zdnkt/swift-tip-initializing-configuring-properties-926c5b86f4b0?source=rss-6d5af3297cb1------2</link>
            <guid isPermaLink="false">https://medium.com/p/926c5b86f4b0</guid>
            <category><![CDATA[swift]]></category>
            <category><![CDATA[xcode]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[tips]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Zdeněk Topič]]></dc:creator>
            <pubDate>Tue, 07 Aug 2018 21:27:11 GMT</pubDate>
            <atom:updated>2018-08-07T22:04:59.335Z</atom:updated>
            <content:encoded><![CDATA[<p>Sometimes, you need to do more than just assign a value to a property on initialization.</p><p><em>This article is also published </em><a href="https://blg.zdnkt.com/swift-tip-initializing-configuring-properties/"><em>on my blog</em></a><em>.</em></p><pre>class Foo {<br>  let formatter = DateFormatter()<br>}</pre><p>You might need to configure some of the properties. The first thing that comes to your mind is probably doing it in an initializer.</p><pre>class Foo {<br>  let formatter = DateFormatter()<br> <br>  init() {<br>    formatter.dateStyle = .short<br>  }<br>}</pre><p>There are more ways how to configure your properties without putting the code in the initializer.</p><pre>class Foo {<br>  let formatter: DateFormatter = {<br>    $0.dateStyle = .short<br>    return $0<br>  }(DateFormatter())<br>}</pre><p>In the example above, you can see that the property DateFormatter is constructed with a closure which takes the instance of DateFormatter as a parameter. You can do the same with initializing the DateFormatter directly in the closure:</p><pre>class Foo {<br>  let formatter: DateFormatter = {<br>    let formatter = DateFormatter()<br>    formatter.dateStyle = .short<br>    return formatter<br>  }()<br>}</pre><p>You can also use a function or a static method to construct the property.</p><pre>func dateFormatter() -&gt; DateFormatter {<br>  let formatter = DateFormatter()<br>  formatter.dateStyle = .short<br>  return formatter<br>}</pre><pre>class Foo {<br>  let formatter: DateFormatter = dateFormatter()<br>}</pre><p>and</p><pre>class Foo {<br>  let formatter: DateFormatter = Foo.dateFormatter()<br> <br>  static func dateFormatter() -&gt; DateFormatter {<br>    let formatter = DateFormatter()<br>    formatter.dateStyle = .short<br>    return formatter<br>  }<br>}</pre><p>All these options work for local variables too.</p><p>Get in touch on <a href="https://twitter.com/zdnkt">Twitter @zdnkt</a> for comments, discussion feedback or ideas!</p><p><em>This article is also published </em><a href="https://blg.zdnkt.com/swift-tip-initializing-configuring-properties/"><em>on my blog</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=926c5b86f4b0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Running Xcode and Simulator in fullscreen]]></title>
            <link>https://medium.com/@zdnkt/running-xcode-and-simulator-in-fullscreen-d4d23e2e7a2b?source=rss-6d5af3297cb1------2</link>
            <guid isPermaLink="false">https://medium.com/p/d4d23e2e7a2b</guid>
            <category><![CDATA[simulator]]></category>
            <category><![CDATA[xcode]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[swift]]></category>
            <category><![CDATA[objective-c]]></category>
            <dc:creator><![CDATA[Zdeněk Topič]]></dc:creator>
            <pubDate>Sun, 05 Aug 2018 10:08:18 GMT</pubDate>
            <atom:updated>2018-08-08T00:51:15.417Z</atom:updated>
            <content:encoded><![CDATA[<p>The way you are switching between the apps, virtual desktops or fullscreen apps affects your workflow, efficiency, and focus. I have a tip how to run Xcode 9 or 10 with Simulator in a divided fullscreen mode so you can focus on the development without distractions.</p><p><em>This article is also published </em><a href="https://blg.zdnkt.com/fullscreen-xcode-and-simulator/"><em>on my blog</em></a><em>.</em></p><h3>☹️ The problem</h3><p>I don’t know about you, but I actually like (a lot) working with Xcode, or with any other IDE (and different apps) in fullscreen. It gives me the full usage of the screen and I can become easily more productive in the app. Also switching between 2 or more apps is easier thanks to macOS gestures. But there is one thing that used to be an issue for me. It was debugging an application. You have 2 options:</p><ol><li>Real device</li><li>or Simulator</li></ol><p>With the real device, you have to pick it up all the time, probably even unlock it for Xcode to be able to run the application. That’s annoying. I used this approach for years because I was thinking “there’s nothing like device”, later I’ve got a little smarter and started using Simulator for most of my testing and debugging. It went fine, but had some pain points:</p><ul><li>every time I had to switch with a gesture to Simulator (and back)</li><li>when Xcode hit breakpoint or app crashed, macOS transitioned me back to Xcode</li><li>you could not look at the app and check console output at the same time</li></ul><p>After a while a realized it bothers me, it is not productive and I lost focus many times.</p><h3>✅ The Solution</h3><p>An 💡 idea popped in my head, why don’t I put it next to Xcode in fullscreen? Unfortunately, Simulator does not support fullscreen mode by default. I did a little research and figured there’s a way, but that’s not all we need, if we had Simulator running in one fullscreen and Xcode in second, it wouldn’t almost any improvement. We need to merge them together to run in divided fullscreen mode. And luckily, that’s enabled for both once they support fullscreen.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lDx3gmWb19OhEbXqSdgybA.png" /><figcaption>On the left side is Xcode 10 beta 5 running in fullscreen and on the right side we have Simulator running iPhone X with iOS 12.</figcaption></figure><h3>💨 The easy way</h3><p>To enable the fullscreen mode in Simulator, just open up Terminal app and <strong>run the following command</strong>:</p><p>defaults write com.apple.iphonesimulator AllowFullscreenMode -bool YES<br><br><strong>That’s it!</strong></p><p>If you want to checkout other settings (the options are in the screenshot below) you can change in Simulator, keep reading and follow the steps.</p><h3>📐 More customizations</h3><p>If you want to do this for <strong>Xcode 9</strong>, then you are fine and <strong>it is all you need</strong>. However, if you are already using <strong>Xcode 10</strong>, you <strong>need both versions</strong> of Xcode (9 and 10) to make it work.</p><p>Apple has hidden features and settings all over the system and their apps. Some of those you can access when you have a directory called AppleInternal in the root of your main volume.</p><h4>❓ What is /AppleInternal?</h4><p>AFAIK it is empty directory Apple engineers use to enable development and debug features, menus, and settings. When you create the directory, a bunch of `Internal` menus might appear across different apps, I recommend to ignore it unless you know what are you doing. We will use it to enable the fullscreen mode for Simulator app.</p><h4>👣 Steps</h4><p>Let’s get to it then!</p><p><strong>1. Check if you need to disable SIP</strong><br>Just <strong>try</strong> to do <strong>step 3</strong>. If it works, continue with step 4 to the end. <strong>In case it fails</strong> with message <em>mkdir: /AppleInternal: Operation not permitted</em>, <strong>go to step 2</strong>.</p><p><strong>2. Disable SIP</strong><br>SIP is <a href="https://support.apple.com/en-us/HT204899">System Integrity Protection</a> introduced in El Capitan. It protects you from viruses and in many cases even from yourself 😜. We need to disable it because /AppleInternal is one of those protected areas.</p><ul><li>restart your computer and hold ⌘ CMD + R until your Mac reboots to Recovery mode</li><li>in top menu select <em>Utilities &gt; Terminal</em></li><li>run csrutil disable</li><li>restart it again using the  menu</li></ul><p><strong>3. Create </strong><strong>/AppleInternal</strong><br>You should be able to create /AppleInternal now.</p><ul><li>open Terminal app</li><li>execute sudo mkdir /AppleInternal`</li></ul><p><strong>4. Enjoy the music 🎉</strong><br>Open the Simulator app thru Xcode 9 (<em>Xcode &gt; Open Developer Tool &gt; Simulator</em>). In the menu, you should now see a new item, `Internal`.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XlN7wzOCQWZRln2NH8wzNg.png" /></figure><p>Just go ahead and have a play with it. Don’t forget to enable fullscreen mode ( <em>Internal &gt; Allow Fullscreen Mode</em>). The changes you make in Xcode 9 Simulator should be also reflected in Xcode 10 Simulator even if it does not show the <em>Internal</em> menu.</p><p><strong>5. Enable SIP</strong><br>When you are finished with your modifications, repeat step 2, but instead of running csrutil disable, <strong>run </strong><strong>csrutil enable </strong>to be safe again.</p><p>I hope you were successful and enjoy the fullscreen mode!</p><p>I will be happy if you reach me on <a href="https://twitter.com/zdnkt">Twitter @zdnkt</a> for comments, questions, feedback, ideas or discussion 😊.</p><p><em>This article is also published </em><a href="https://blg.zdnkt.com/fullscreen-xcode-and-simulator/"><em>on my blog</em></a><em>.</em></p><h4>More where this came from</h4><p>This story is published in <a href="http://blog.usejournal.com/">Noteworthy</a>, where thousands come every day to learn about the people &amp; ideas shaping the products we love.</p><p>Follow our publication to see more product &amp; design stories featured by the <a href="https://usejournal.com/?utm_source=usejournal.com&amp;utm_medium=blog&amp;utm_campaign=guest_post">Journal</a> team.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d4d23e2e7a2b" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>