<?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" xmlns:media="http://search.yahoo.com/mrss/" version="2.0">
    <channel>
        
        <title>
            <![CDATA[ iphone - freeCodeCamp.org ]]>
        </title>
        <description>
            <![CDATA[ Browse thousands of programming tutorials written by experts. Learn Web Development, Data Science, DevOps, Security, and get developer career advice. ]]>
        </description>
        <link>https://www.freecodecamp.org/news/</link>
        <image>
            <url>https://cdn.freecodecamp.org/universal/favicons/favicon.png</url>
            <title>
                <![CDATA[ iphone - freeCodeCamp.org ]]>
            </title>
            <link>https://www.freecodecamp.org/news/</link>
        </image>
        <generator>Eleventy</generator>
        <lastBuildDate>Tue, 28 Jul 2026 03:51:28 +0000</lastBuildDate>
        <atom:link href="https://www.freecodecamp.org/news/tag/iphone/rss.xml" rel="self" type="application/rss+xml" />
        <ttl>60</ttl>
        
            <item>
                <title>
                    <![CDATA[ How to Use the Screen Reader That's Built into Your iPhone ]]>
                </title>
                <description>
                    <![CDATA[ Every iPhone and iPad includes a built-in screen reader called VoiceOver. VoiceOver speaks aloud the text on the screen, app names, icons, buttons, menus, links, and notifications and alerts. These ac ]]>
                </description>
                <link>https://www.freecodecamp.org/news/how-to-use-the-screen-reader-that-s-built-into-your-iphone/</link>
                <guid isPermaLink="false">6a442b57dd852a5d76691859</guid>
                
                    <category>
                        <![CDATA[ Accessibility ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Web Development ]]>
                    </category>
                
                    <category>
                        <![CDATA[ iphone ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Screen Reader ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ Ilknur Eren ]]>
                </dc:creator>
                <pubDate>Tue, 30 Jun 2026 20:47:19 +0000</pubDate>
                <media:content url="https://cdn.hashnode.com/uploads/covers/5e1e335a7a1d3fcc59028c64/b5b3867f-7404-4557-85e6-bc508c88a961.png" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>Every iPhone and iPad includes a built-in screen reader called VoiceOver.</p>
<p>VoiceOver speaks aloud the text on the screen, app names, icons, buttons, menus, links, and notifications and alerts.</p>
<p>These accessibility features are crucial for users who may be blind, have low vision, or have reading differences.</p>
<p>As a developer, it's always important to manually test your website for accessibility. A screen reader is one of the most important tools to add to your testing process. Even small issues, like a button with no label or an image with no alt text, can make a page completely unusable for someone relying on VoiceOver.</p>
<p>As you test on an actual device with VoiceOver, you may find accessibility issues you didn’t know you had. In this tutorial, we'll cover how to turn VoiceOver on, the basic gestures to know, and how to adjust its settings to fit your needs.</p>
<h3 id="heading-what-well-cover">What We'll Cover:</h3>
<ul>
<li><p><a href="#heading-how-to-turn-on-voiceover">How to turn on VoiceOver</a></p>
<ul>
<li><p><a href="#heading-option-1-use-settings">Option 1: Use Settings</a></p>
</li>
<li><p><a href="#heading-option-2-use-siri">Option 2: Use Siri</a></p>
</li>
<li><p><a href="#heading-option-3-set-up-the-accessibility-shortcut">Option 3: Set up the Accessibility Shortcut</a></p>
</li>
</ul>
</li>
<li><p><a href="#heading-basic-gestures-to-know">Basic Gestures to Know</a></p>
</li>
<li><p><a href="#heading-how-to-adjust-voiceover-settings">How to Adjust VoiceOver Settings</a></p>
<ul>
<li><p><a href="#heading-change-the-speaking-rate">Change the Speaking Rate</a></p>
</li>
<li><p><a href="#heading-change-the-voice">Change the Voice</a></p>
</li>
</ul>
</li>
<li><p><a href="#heading-conclusion">Conclusion</a></p>
</li>
</ul>
<h2 id="heading-how-to-turn-on-voiceover"><strong>How to Turn On VoiceOver</strong></h2>
<p>There are a few ways to turn VoiceOver on or off. As you practice, you might lean toward one option over the others.</p>
<h3 id="heading-option-1-use-settings">Option 1: Use Settings</h3>
<ol>
<li><p>Open the <strong>Settings</strong> app.</p>
</li>
<li><p>Tap <strong>Accessibility</strong>.</p>
</li>
<li><p>Tap <strong>VoiceOver</strong>.</p>
</li>
<li><p>Toggle it on or off.</p>
</li>
</ol>
<p>In the Accessibility Settings section, you can also find other accessible settings to explore — including Display &amp; Text Size, Motion, and Spoken Content. It's worth browsing through to understand what tools are available to users.</p>
<img src="https://cdn.hashnode.com/uploads/covers/68379e7b1fd0b956f4ad9839/d6b8dc8e-cb17-481d-a0cd-a8966448f7c7.png" alt="iOS Accessibility setting page" style="display:block;margin:0 auto" width="1125" height="2436" loading="lazy">

<img src="https://cdn.hashnode.com/uploads/covers/68379e7b1fd0b956f4ad9839/416f54e2-5c86-436c-a870-1ec65ed9128f.png" alt="iOS Accessibility Setting VoiceOver Section" style="display:block;margin:0 auto" width="1125" height="2436" loading="lazy">

<h3 id="heading-option-2-use-siri">Option 2: Use Siri</h3>
<p>To turn on VoiceOver using Siri, say: <strong>"Hey Siri, turn on VoiceOver."</strong></p>
<p>To turn it off, say: <strong>"Hey Siri, turn off VoiceOver."</strong></p>
<p>Using Siri might be the easiest way to turn VoiceOver on or off for beginners. If you accidentally turn VoiceOver on and don't yet know any shortcuts or gestures, just ask Siri. Siri works independently of VoiceOver gestures, so it's a reliable fallback when you feel stuck.</p>
<h3 id="heading-option-3-set-up-the-accessibility-shortcut">Option 3: Set Up the Accessibility Shortcut</h3>
<p>If you find yourself turning VoiceOver on and off frequently, setting up the Accessibility Shortcut makes sense. This is the quickest method for developers who are regularly switching VoiceOver on to test and off to work. It lets you toggle VoiceOver by pressing the side button three times.</p>
<ol>
<li><p>Go to <strong>Settings &gt; Accessibility</strong>.</p>
</li>
<li><p>Scroll down and tap <strong>Accessibility Shortcut</strong>.</p>
</li>
<li><p>Select <strong>VoiceOver</strong>.</p>
</li>
</ol>
<p>After that, press the side button (or Home button on older iPhones) <strong>three times</strong> to toggle VoiceOver on or off. If you have more than one accessibility feature enabled in the shortcut, your iPhone will show a menu to pick from instead of toggling automatically.</p>
<h2 id="heading-basic-gestures-to-know"><strong>Basic Gestures to Know</strong></h2>
<p>When VoiceOver is on, the way you touch the screen changes what the phone interprets. The same swipe or tap that normally opens an app does something different with VoiceOver active.</p>
<p>Here are the five core gestures every developer should learn first:</p>
<ul>
<li><p><strong>Swipe right</strong>: Move to the next item on screen</p>
</li>
<li><p><strong>Swipe left</strong>: Move to the previous item on screen</p>
</li>
<li><p><strong>Swipe up or down with three fingers</strong>: Scroll up or down the page</p>
</li>
<li><p><strong>One tap</strong>: Hear VoiceOver read the item aloud</p>
</li>
<li><p><strong>Double-tap</strong>: Open an app or activate a button</p>
</li>
</ul>
<p><strong>Tip:</strong> When you first tap an item, VoiceOver reads it to you. Then you can double-tap to actually open or activate it. This two-step process helps you confirm you're on the right element before you act. This is especially useful when testing unfamiliar interfaces.</p>
<p>These five gestures are the foundation. As you use VoiceOver more frequently, they'll become second nature. Once you're comfortable, you can explore more advanced gestures like the VoiceOver rotor, which lets you navigate by headings, links, form fields, and more.</p>
<p>For the time being, if you're comfortable with these five gestures, you’ll be able to test mobile accessibility issues for your products.</p>
<h2 id="heading-how-to-adjust-voiceover-settings"><strong>How to Adjust VoiceOver Settings</strong></h2>
<p>You can change how VoiceOver sounds and behaves to better suit your testing workflow or personal preferences.</p>
<h3 id="heading-change-the-speaking-rate">Change the Speaking Rate</h3>
<ol>
<li><p>Go to <strong>Settings &gt; Accessibility &gt; VoiceOver</strong>.</p>
</li>
<li><p>Use the <strong>Speaking Rate</strong> slider to make it faster or slower.</p>
</li>
</ol>
<p>You can also adjust the speaking rate with the VoiceOver rotor. Rotate two fingers on the screen until you hear “Speaking Rate,” then swipe up or down with one finger to make VoiceOver faster or slower.</p>
<p>This changes the rate on the fly without going into Settings. It's handy when you want to slow down while exploring a complex page or speed up when navigating familiar content.</p>
<p>Experienced VoiceOver users often run the speaking rate very fast. Don't be surprised if the default speed feels quick. You can always slow it down while you're learning.</p>
<img src="https://cdn.hashnode.com/uploads/covers/68379e7b1fd0b956f4ad9839/4247bbbb-44e7-43c6-a341-07f0c7b3fc2e.png" alt="iOS Accessibility Speaking Rate Section" style="display:block;margin:0 auto" width="1125" height="2436" loading="lazy">

<h3 id="heading-change-the-voice">Change the Voice</h3>
<p>If you want to change the voice or language, Go to Settings &gt; Accessibility &gt; VoiceOver &gt; Speech. From there, you can choose a different VoiceOver voice, add rotor voices for other languages, or enable language detection.</p>
<p>Apple offers multiple voice options across many languages. This is useful when testing multilingual content, but make sure your site also uses correct <code>lang</code> attributes so screen readers can switch pronunciation appropriately.</p>
<h2 id="heading-conclusion"><strong>Conclusion</strong></h2>
<p>As a developer, it's always important to manually test your website for accessibility. Testing it with the accessibility features your users use is crucial to access the product through their lens and fix accessibility bugs the product might have.</p>
<p>Simply turning the VoiceOver on and learning about these five simple gestures will give you the tools to audit and test your website for accessibility issues.</p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ How to Record a Phone Call on iPhone ]]>
                </title>
                <description>
                    <![CDATA[ There are a few ways to record your phone calls on your iPhone. But it is really important that you ask for the other caller's permission first before making a recording. Is there a built in recording option? There is no built in option on iPhone to ... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/how-to-record-a-phone-call-on-iphone/</link>
                <guid isPermaLink="false">66b8d99b2755c964523f0564</guid>
                
                    <category>
                        <![CDATA[ beginners guide ]]>
                    </category>
                
                    <category>
                        <![CDATA[ how-to ]]>
                    </category>
                
                    <category>
                        <![CDATA[ iphone ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ Jessica Wilkins ]]>
                </dc:creator>
                <pubDate>Wed, 27 Oct 2021 18:35:31 +0000</pubDate>
                <media:content url="https://www.freecodecamp.org/news/content/images/2021/10/onur-binay-OKjJZNTl004-unsplash.jpg" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>There are a few ways to record your phone calls on your iPhone. But it is really important that you ask for the other caller's permission first before making a recording.</p>
<h2 id="heading-is-there-a-built-in-recording-option">Is there a built in recording option?</h2>
<p>There is no built in option on iPhone to record your phone calls.</p>
<p>In most areas around the world, it is illegal to record someone without their expressed permission. </p>
<p>There are other apps and devices that you can use to record your phone calls, but always remember to ask for permission first. </p>
<p>It is also best to check the laws in your area concerning recording phone calls. </p>
<h2 id="heading-how-to-use-a-separate-device-to-record-calls-on-iphone">How to use a separate device to record calls on iPhone</h2>
<p>One of the simplest ways to record a phone call is to use another device like a tablet, recorder, or computer. Once you have permission, hit record on the other device.</p>
<p>One you are done recording, then you can save that recording to the device or upload it to the iCloud. </p>
<h2 id="heading-using-google-voice">Using Google Voice</h2>
<p>Google Voice has an option to record phone calls, but there are a few restrictions.</p>
<p>The first thing to consider is that Google Voice will only record incoming phone calls to your Google Voice number. This will not work for outgoing phone calls.</p>
<p>It is free to get a <a target="_blank" href="https://voice.google.com/about">Google voice number</a> and download the app to your phone.</p>
<p>You will need to login to your account and follow the <a target="_blank" href="https://support.google.com/voice/answer/115061?hl=en&amp;co=GENIE.Platform%3DDesktop">directions</a> on how to setup your Google voice number. You can then go to the app store and search for the Google voice app.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/10/IMG_FFE535511785-1-2.jpeg" alt="Image" width="600" height="400" loading="lazy"></p>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/10/IMG_D0B0AB533519-1-1.jpeg" alt="Image" width="600" height="400" loading="lazy"></p>
<p>Once you are set up with your new Google Voice number, then you can start receiving incoming calls. When someone calls you, press the number 4 on your keypad to start recording the call.</p>
<p>Remember to ask for permission from all participants on the call before you start recording. </p>
<p>To stop the recording, press the number 4 on your keypad again.</p>
<h2 id="heading-how-to-use-other-third-party-apps-to-record-calls-on-iphone">How to use other third party apps to record calls on iPhone</h2>
<p>There are other apps you can use that will record your phone calls. Some of these options include Call Recorder or TapeACall.</p>
<p>A lot of these apps will be free to download, but will charge you per minute for the phone calls. Some apps will have free trial periods but it is really important to read the fine print before downloading the apps. </p>
<h2 id="heading-what-is-the-best-option">What is the best option?</h2>
<p>If you are looking for an easy hassle free option, then using another device to record your phone calls is the way to go. </p>
<p>If you don't mind paying for an app to record your phone calls, then research through reviews in the app store to choose an application that suits your needs. </p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ iPhone Downloads Folder – Where are my Downloads? iOS and iPad ]]>
                </title>
                <description>
                    <![CDATA[ iPhone and iPad both have an app called Files where you can locate all of your files from services including iCloud Drive, Dropbox, and more.  If you want to access the Downloads folder, you can find it inside the Files app. In this article, I will s... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/iphone-downloads-folder-where-are-my-downloads-ios-and-ipad/</link>
                <guid isPermaLink="false">66b8d9d3167e676eda514f6b</guid>
                
                    <category>
                        <![CDATA[ beginners guide ]]>
                    </category>
                
                    <category>
                        <![CDATA[ how-to ]]>
                    </category>
                
                    <category>
                        <![CDATA[ iOS ]]>
                    </category>
                
                    <category>
                        <![CDATA[ iphone ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ Jessica Wilkins ]]>
                </dc:creator>
                <pubDate>Thu, 14 Oct 2021 21:59:03 +0000</pubDate>
                <media:content url="https://www.freecodecamp.org/news/content/images/2021/10/kevin-bhagat-Co-usQ-kpO0-unsplash.jpg" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>iPhone and iPad both have an app called Files where you can locate all of your files from services including iCloud Drive, Dropbox, and more. </p>
<p>If you want to access the Downloads folder, you can find it inside the Files app. In this article, I will show you how to access the Files app and the Downloads folder. </p>
<h2 id="heading-how-to-locate-the-files-app-on-iphone-and-ipad">How to locate the Files App on iPhone and iPad</h2>
<p>If you have an iPhone and iPad running iOS 11 or later, the Files app is automatically loaded into your device.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/10/IMG_620DBD8F833B-1.jpeg" alt="Image" width="600" height="400" loading="lazy"></p>
<p>You can also use the search feature to find the Files app.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/10/IMG_43A9B3862235-1.jpeg" alt="Image" width="600" height="400" loading="lazy"></p>
<h2 id="heading-how-to-locate-the-downloads-folder-on-iphone-and-ipad">How to locate the Downloads folder on iPhone and iPad</h2>
<p>Step 1: Open the Files app</p>
<p>Step 2: Click on the Browse </p>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/10/IMG_B02829DF17F7-1.jpeg" alt="Image" width="600" height="400" loading="lazy"></p>
<p>Step 3: Click On My iPhone under Locations</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/10/IMG_3475EB49148B-1.jpeg" alt="Image" width="600" height="400" loading="lazy"></p>
<p>Step 4: Click on the Downloads folder</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/10/IMG_243C9B5BA317-1.jpeg" alt="Image" width="600" height="400" loading="lazy"></p>
<p>Then you can see all of your downloaded files.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/10/IMG_AE67A8A7D212-1.jpeg" alt="Image" width="600" height="400" loading="lazy"></p>
<p>If you hold your finger down on the file you want to select, then you can see a list of available options. </p>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/10/IMG_29103C3000C3-1.jpeg" alt="Image" width="600" height="400" loading="lazy"></p>
<p>Now you can copy, delete, share, rename, and perform many other options on those files.</p>
<p>Thanks for reading, and happy browsing!</p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ How to Delete Albums on iPhone ]]>
                </title>
                <description>
                    <![CDATA[ If you want to delete a photo album on an iPhone, it only takes a few simple steps.  In this short article, I will walk you through the six steps to delete an album from your iPhone.  Step 1: Go to the Photos app on your phone First, ]]>
                </description>
                <link>https://www.freecodecamp.org/news/how-to-delete-albums-on-iphone/</link>
                <guid isPermaLink="false">66b8d97ff805ffd579552e8a</guid>
                
                    <category>
                        <![CDATA[ how-to ]]>
                    </category>
                
                    <category>
                        <![CDATA[ iOS ]]>
                    </category>
                
                    <category>
                        <![CDATA[ iphone ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ Jessica Wilkins ]]>
                </dc:creator>
                <pubDate>Wed, 01 Sep 2021 17:53:57 +0000</pubDate>
                <media:content url="https://www.freecodecamp.org/news/content/images/2021/09/arnel-hasanovic-4oWSXdeAS2g-unsplash.jpg" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>If you want to delete a photo album on an iPhone, it only takes a few simple steps. </p>
<p>In this short article, I will walk you through the six steps to delete an album from your iPhone. </p>
<h3 id="heading-step-1-go-to-the-photos-app-on-your-phone">Step 1: Go to the Photos app on your phone</h3>
<p>First, you need to open the photos app.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/09/photos-1.jpeg" alt="Image" width="600" height="400" loading="lazy"></p>
<h3 id="heading-step-2-go-to-albums">Step 2: Go to Albums</h3>
<p>Next, go to the "Albums" tab in Photos.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/09/click-albums.jpeg" alt="Image" width="600" height="400" loading="lazy"></p>
<h3 id="heading-step-3-click-see-all">Step 3: Click "See All"</h3>
<p>To see all your albums, you'll need to click the "See All" button located at the top right hand corner</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/09/click-see-all.jpeg" alt="Image" width="600" height="400" loading="lazy"></p>
<h3 id="heading-step-4-edit-the-albums">Step 4: Edit the Albums</h3>
<p>Then you'll click on Edit located at the top right hand corner.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/09/click-edit.jpeg" alt="Image" width="600" height="400" loading="lazy"></p>
<h3 id="heading-step-5-select-the-albums-you-want-to-delete">Step 5: Select the album(s) you want to delete</h3>
<p>Click on the red circled dash on the album you want to delete. This will select it.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/09/click-red-dash.jpeg" alt="Image" width="600" height="400" loading="lazy"></p>
<h3 id="heading-step-6-delete-the-albums">Step 6: Delete the album(s)</h3>
<p>Click the red Delete Album text and the album will be deleted.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/09/confirm-delete.jpeg" alt="Image" width="600" height="400" loading="lazy"></p>
<p>It is important to note that if you delete an album it does not delete the photos from your phone. </p>
<p>If you want to delete a photo, then you will need to choose the photo from the library and click on the trash can icon on the bottom right hand corner. </p>
<h2 id="heading-why-cant-i-delete-all-of-the-albums-from-my-phone">Why can't I delete all of the albums from my phone?</h2>
<p>There are certain albums on the iPhone that you cannot remove. If you followed the steps above, you will notice that there is no red dash above the Recents or Favorites albums.</p>
<p>Those are the default albums that already come on the iPhone. Other default albums like Screenshots and Selfies cannot be deleted, either. </p>
<p>You can only delete albums that you have created on your phone yourself. </p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ How to programmatically build a Spotify clone for iOS using AutoLayout: adding photos and updating the UI ]]>
                </title>
                <description>
                    <![CDATA[ By Said Hayani This is the second part of an article on building a Spotify UI clone with autoLayout programmatically. If you missed the first part, no worries - just please go and check it now.  In this article, we are going to add some mocked pictur... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/how-to-build-a-spotify-clone-for-ios-with-autolayout-programmatically-part-2/</link>
                <guid isPermaLink="false">66d460d2868774922c885008</guid>
                
                    <category>
                        <![CDATA[ 100DaysOfCode ]]>
                    </category>
                
                    <category>
                        <![CDATA[ app development ]]>
                    </category>
                
                    <category>
                        <![CDATA[ autolayout ]]>
                    </category>
                
                    <category>
                        <![CDATA[ iOS ]]>
                    </category>
                
                    <category>
                        <![CDATA[ iOS13 ]]>
                    </category>
                
                    <category>
                        <![CDATA[ iphone ]]>
                    </category>
                
                    <category>
                        <![CDATA[ learning ]]>
                    </category>
                
                    <category>
                        <![CDATA[ learning to code ]]>
                    </category>
                
                    <category>
                        <![CDATA[ mobile ]]>
                    </category>
                
                    <category>
                        <![CDATA[ programing ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Swift ]]>
                    </category>
                
                    <category>
                        <![CDATA[ tech  ]]>
                    </category>
                
                    <category>
                        <![CDATA[ technology ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Tutorial ]]>
                    </category>
                
                    <category>
                        <![CDATA[ User Interface ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ freeCodeCamp ]]>
                </dc:creator>
                <pubDate>Tue, 10 Dec 2019 03:44:03 +0000</pubDate>
                <media:content url="https://www.freecodecamp.org/news/content/images/2019/12/featured_image-4.png" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>By Said Hayani</p>
<p>This is the second part of an article on building a Spotify UI clone with autoLayout programmatically. If you missed the first part, no worries - just please go and <a target="_blank" href="https://www.freecodecamp.org/news/autolayout-programmatically-spotify-clone-in-swift/">check it now</a>. </p>
<p>In this article, we are going to add some mocked pictures and try to make the UI look the same as Spotify's.</p>
<p>This is what we are going to do today ?</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2019/12/Screen-Shot-2019-12-09-at-9.55.19-PM-1.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>This is were we left off in the first part:</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2019/12/complet-layout-demo1.gif" alt="Image" width="600" height="400" loading="lazy"></p>
<p>The next step is to create customized cells. So let's start by creating one with the name  <code>SubCustomCell</code>.</p>
<p>First, create a new Swift file inside the project folder and name it <code>SubCustomCell.swift</code>. This file will contain our custom cell that will represent the Playlist. After creating the file, try to add in the code below and initialize the cell, maybe with <code>backgroundColor</code>,  to see the UI changes when we register the cell with the <code>collectionView</code>. </p>
<pre><code class="lang-swift"><span class="hljs-keyword">import</span> UIKit

<span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">SubCustomCell</span>: <span class="hljs-title">UICollectionViewCell</span> </span>{
        <span class="hljs-keyword">override</span> <span class="hljs-keyword">init</span>(frame: <span class="hljs-type">CGRect</span>) {
        <span class="hljs-keyword">super</span>.<span class="hljs-keyword">init</span>(frame: frame)
        backgroundColor = .red
    }

    <span class="hljs-keyword">required</span> <span class="hljs-keyword">init</span>?(coder aDecoder: <span class="hljs-type">NSCoder</span>) {
        <span class="hljs-built_in">fatalError</span>(<span class="hljs-string">"init(coder:) has not been implemented"</span>)
    }
}
</code></pre>
<p>Then we register the <code>SubCustomCell</code>  inside <code>CustomCell.swift</code> within the <code>init</code> block. Replace <code>UICollectionViewCell.self</code> with  <code>SubCustomCell</code> like below.</p>
<pre><code class="lang-swift"> collectionView.register(<span class="hljs-type">SubCustomCell</span>.<span class="hljs-keyword">self</span>, forCellWithReuseIdentifier: cellId)
</code></pre>
<p>Also we need to make a modification on the <code>cellForItemAt</code> method and make it conform to  <code>SubCustomCell</code> like the following.</p>
<pre><code class="lang-swift"> <span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-title">collectionView</span><span class="hljs-params">(<span class="hljs-number">_</span> collectionView: UICollectionView, cellForItemAt indexPath: IndexPath)</span></span> -&gt; <span class="hljs-type">UICollectionViewCell</span> {
        <span class="hljs-keyword">let</span> cell = collectionView.dequeueReusableCell(withReuseIdentifier: cellId, <span class="hljs-keyword">for</span>: indexPath) <span class="hljs-keyword">as</span>! <span class="hljs-type">SubCustomCell</span>
        <span class="hljs-comment">// cell.backgroundColor = .yellow</span>

        <span class="hljs-keyword">return</span> cell
    }
</code></pre>
<p>You should see the <code>backgroundColor</code> changed to <code>red</code> .</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2019/12/Screen-Shot-2019-12-03-at-1.10.25-AM.png" alt="Image" width="600" height="400" loading="lazy">
<em>Swift CustomCell</em></p>
<p>Up until this point everything should be straightforward and clear.</p>
<p>Now we're going to fill the cells with some mocked pictures and create an <code>ImageView</code> inside each cell. I already downloaded some random pictures from <a target="_blank" href="https://www.pexels.com/">pexels.com,</a> but feel free to use any pictures you like (including these). You can find them in the <a target="_blank" href="https://github.com/hayanisaid/autoLayout-programmatically-in-swift">project files on Github</a>.</p>
<p>Let's create the <code>UIImageView</code> inside <code>SubCustomCell.swift</code> and make some constraints.</p>
<pre><code class="lang-swift">    <span class="hljs-keyword">let</span> <span class="hljs-type">ImageView</span> : <span class="hljs-type">UIImageView</span> = {
       <span class="hljs-keyword">let</span> iv = <span class="hljs-type">UIImageView</span>()
        iv.backgroundColor = .yellow
        <span class="hljs-keyword">return</span> iv

    }()
</code></pre>
<p>And add it to the <code>view</code> within the <code>init</code> block using <code>addSubView</code>.</p>
<pre><code class="lang-swift"> <span class="hljs-keyword">override</span> <span class="hljs-keyword">init</span>(frame: <span class="hljs-type">CGRect</span>) {
        <span class="hljs-keyword">super</span>.<span class="hljs-keyword">init</span>(frame: frame)
        addSubview(<span class="hljs-type">ImageView</span>)

    }
</code></pre>
<p>Now let's make the <code>ImageView</code> take up all the space within the cell with the constraints below.</p>
<pre><code class="lang-swift"> <span class="hljs-type">ImageView</span>.translatesAutoresizingMaskIntoConstraints = <span class="hljs-literal">false</span>
            <span class="hljs-type">ImageView</span>.topAnchor.constraint(equalTo: topAnchor).isActive = <span class="hljs-literal">true</span>
            <span class="hljs-type">ImageView</span>.leftAnchor.constraint(equalTo: leftAnchor).isActive = <span class="hljs-literal">true</span>
            <span class="hljs-type">ImageView</span>.rightAnchor.constraint(equalTo: rightAnchor).isActive = <span class="hljs-literal">true</span>
            <span class="hljs-type">ImageView</span>.bottomAnchor.constraint(equalTo: bottomAnchor).isActive = <span class="hljs-literal">true</span>
</code></pre>
<ul>
<li><code>LeftAnchor</code> represents the left anchor of the cell</li>
<li><code>rightAnchor</code> represents the right anchor of the cell</li>
<li><code>bottomAnchor</code> represents the bottom anchor of the cell </li>
<li><code>topAnchor</code> represents the top anchor of the cell</li>
</ul>
<p>And by making <code>ImageView</code> 's top anchor equal to the cell's top anchor (and doing the same for <code>ImageView</code> 's left, right, and bottom anchor) it makes the <code>ImageView</code> take up all the space of the <code>SubCustomCell</code> (cell).</p>
<p>Note: first you need to use <code>translatesAutoresizingMaskIntoConstraints</code> to be able to apply the constraints to the elements. Also don't forget to call <code>isActive</code> property and assign it to <code>true</code> – without doing that the constraints won't work and nothing will change.</p>
<p>The <code>ImageView</code> should have an image, so let's add one.</p>
<pre><code class="lang-swift"> <span class="hljs-keyword">let</span> <span class="hljs-type">ImageView</span> : <span class="hljs-type">UIImageView</span> = {
       <span class="hljs-keyword">let</span> iv = <span class="hljs-type">UIImageView</span>()
        iv.backgroundColor = .yellow
        <span class="hljs-comment">// we have &gt;image1&lt; file inside the project </span>
        iv.image = <span class="hljs-type">UIImage</span>(named: <span class="hljs-string">"image1"</span>)
        iv.contentMode = .scaleAspectFill
        iv.clipsToBounds = <span class="hljs-literal">true</span>

        <span class="hljs-keyword">return</span> iv

    }()
</code></pre>
<p>And if you build and run the app, you should see the results and picture we added to the <code>SubCustomCell</code>.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2019/12/Screen-Shot-2019-12-03-at-1.37.51-AM.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>Cool ?. Now there is an element we should add to the <code>SubCustomCell</code> to finish up. We need a title that will represent the title of the playlist:  <code>UILabel</code>.</p>
<p>For the title it will be like this:</p>
<pre><code class="lang-swift"> <span class="hljs-keyword">let</span> <span class="hljs-type">TitleLabel</span> : <span class="hljs-type">UILabel</span> = {
        <span class="hljs-keyword">let</span> lb = <span class="hljs-type">UILabel</span>()
        lb.textColor = <span class="hljs-type">UIColor</span>.lightGray
        lb.font = <span class="hljs-type">UIFont</span>.systemFont(ofSize: <span class="hljs-number">16</span>)
        lb.font = <span class="hljs-type">UIFont</span>.boldSystemFont(ofSize: <span class="hljs-number">20</span>)
        lb.text = <span class="hljs-string">"Evening Music"</span>

        <span class="hljs-keyword">return</span> lb
    }()
</code></pre>
<p>I just put some random text there – you can put whatever you like. The next step is to add the element to the view and give it some constraints. The title will be placed at the bottom of the <code>ImageView</code>.</p>
<h3 id="heading-add-to-view">Add to view:</h3>
<pre><code class="lang-swift">addSubview(<span class="hljs-type">TitleLabel</span>)
</code></pre>
<h3 id="heading-applying-the-constraints-for-both-the-imageview-and-the-titlelabel">Applying the constraints for both the <code>ImageView</code> and the <code>TitleLabel</code></h3>
<pre><code class="lang-swift"> <span class="hljs-type">ImageView</span>.translatesAutoresizingMaskIntoConstraints = <span class="hljs-literal">false</span>
            <span class="hljs-type">ImageView</span>.topAnchor.constraint(equalTo: topAnchor).isActive = <span class="hljs-literal">true</span>
            <span class="hljs-type">ImageView</span>.leftAnchor.constraint(equalTo: leftAnchor).isActive = <span class="hljs-literal">true</span>
            <span class="hljs-type">ImageView</span>.rightAnchor.constraint(equalTo: rightAnchor).isActive = <span class="hljs-literal">true</span>
            <span class="hljs-type">ImageView</span>.heightAnchor.constraint(equalToConstant: <span class="hljs-number">240</span>).isActive = <span class="hljs-literal">true</span>
            <span class="hljs-type">ImageView</span>.bottomAnchor.constraint(equalTo: <span class="hljs-type">TitleLabel</span>.topAnchor).isActive = <span class="hljs-literal">true</span>



            <span class="hljs-type">TitleLabel</span>.translatesAutoresizingMaskIntoConstraints = <span class="hljs-literal">false</span>
            <span class="hljs-type">TitleLabel</span>.topAnchor.constraint(equalTo: <span class="hljs-type">ImageView</span>.bottomAnchor,constant: <span class="hljs-number">10</span>).isActive = <span class="hljs-literal">true</span>
            <span class="hljs-type">TitleLabel</span>.leftAnchor.constraint(equalTo: leftAnchor, constant: <span class="hljs-number">5</span>).isActive = <span class="hljs-literal">true</span>
            <span class="hljs-type">TitleLabel</span>.rightAnchor.constraint(equalTo: rightAnchor, constant: -<span class="hljs-number">5</span>).isActive = <span class="hljs-literal">true</span>
</code></pre>
<p>And here we go!</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2019/12/Screen-Shot-2019-12-06-at-1.45.10-AM.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>We made the picture take up most of the space in the cell, and the rest is taken up by the title. As you can see, you can scroll horizontally in each section and also vertically in the entire screen.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2019/12/demo2.gif" alt="Image" width="600" height="400" loading="lazy"></p>
<p>Now we are put some mock data into the cells to make it feel like it's real. For that I created a <code>JSON</code> file that contains some random data for sections and playlists.</p>
<p>First let's create a two structs, <code>Section</code> and <code>Playlist</code> . We create a separate file for each struct. </p>
<p> <code>section.swift</code> </p>
<pre><code class="lang-swift"><span class="hljs-keyword">import</span> Foundation
<span class="hljs-class"><span class="hljs-keyword">struct</span> <span class="hljs-title">Section</span> </span>{
    <span class="hljs-keyword">var</span> title : <span class="hljs-type">String</span>
    <span class="hljs-keyword">var</span> playlists : <span class="hljs-type">NSArray</span>
    <span class="hljs-keyword">init</span>(dictionary:[<span class="hljs-type">String</span> : <span class="hljs-type">Any</span>]) {
        <span class="hljs-keyword">self</span>.title = dictionary[<span class="hljs-string">"title"</span>] <span class="hljs-keyword">as</span>? <span class="hljs-type">String</span> ?? <span class="hljs-string">""</span>
        <span class="hljs-keyword">self</span>.playlists = dictionary[<span class="hljs-string">"playlists"</span>] <span class="hljs-keyword">as</span>? <span class="hljs-type">NSArray</span> ?? []

}
}
</code></pre>
<p><code>playlist.swift</code></p>
<pre><code class="lang-swift"><span class="hljs-comment">//</span>
<span class="hljs-comment">//  playlist.swift</span>
<span class="hljs-comment">//  spotifyAutoLayout</span>
<span class="hljs-comment">//</span>
<span class="hljs-comment">//  Created by admin on 12/6/19.</span>
<span class="hljs-comment">//  Copyright © 2019 Said Hayani. All rights reserved.</span>
<span class="hljs-comment">//</span>

<span class="hljs-keyword">import</span> Foundation
<span class="hljs-class"><span class="hljs-keyword">struct</span> <span class="hljs-title">PlayList</span> </span>{
    <span class="hljs-keyword">var</span> title: <span class="hljs-type">String</span>
    <span class="hljs-keyword">var</span> image : <span class="hljs-type">String</span>
    <span class="hljs-keyword">init</span>(dictionary : [<span class="hljs-type">String</span> : <span class="hljs-type">Any</span>]) {
        <span class="hljs-keyword">self</span>.title = dictionary[<span class="hljs-string">"title"</span>] <span class="hljs-keyword">as</span>? <span class="hljs-type">String</span> ?? <span class="hljs-string">""</span>
        <span class="hljs-keyword">self</span>.image = dictionary[<span class="hljs-string">"image"</span>] <span class="hljs-keyword">as</span>? <span class="hljs-type">String</span> ?? <span class="hljs-string">""</span>
    }

}
</code></pre>
<p>And then inside <code>ViewController.swift</code> we create a function that fetches the JSON for us and stores the results in an array.</p>
<pre><code class="lang-swift">
        <span class="hljs-built_in">print</span>(<span class="hljs-string">"attempt to fetch Json"</span>)
        <span class="hljs-keyword">if</span> <span class="hljs-keyword">let</span> path = <span class="hljs-type">Bundle</span>.main.path(forResource: <span class="hljs-string">"test"</span>, ofType: <span class="hljs-string">"json"</span>) {
            <span class="hljs-keyword">do</span> {
                  <span class="hljs-keyword">let</span> data = <span class="hljs-keyword">try</span> <span class="hljs-type">Data</span>(contentsOf: <span class="hljs-type">URL</span>(fileURLWithPath: path), options: .mappedIfSafe)
                  <span class="hljs-keyword">let</span> jsonResult = <span class="hljs-keyword">try</span> <span class="hljs-type">JSONSerialization</span>.jsonObject(with: data, options: .mutableLeaves)
                <span class="hljs-keyword">if</span> <span class="hljs-keyword">let</span> jsonResult = jsonResult <span class="hljs-keyword">as</span>? [ <span class="hljs-type">Any</span>] {
                            <span class="hljs-comment">// do stuff</span>
                    jsonResult.forEach { (item) <span class="hljs-keyword">in</span>

                        <span class="hljs-keyword">let</span> section = <span class="hljs-type">Section</span>(dictionary: item <span class="hljs-keyword">as</span>! [<span class="hljs-type">String</span> : <span class="hljs-type">Any</span>])
                       <span class="hljs-comment">// print("FEtching",section.playlists)</span>
                        <span class="hljs-keyword">self</span>.sections.append(section)
                    }


                  <span class="hljs-keyword">self</span>.collectionView.reloadData()
                  }
              } <span class="hljs-keyword">catch</span> {
                   <span class="hljs-comment">// handle error</span>
              }
        }
    }
</code></pre>
<p>The <code>fetchJson</code> function is called within the <code>ViewDidLoad</code> method. We also have a variable called <code>sections</code> where we store the results:</p>
<pre><code class="lang-swift"> <span class="hljs-keyword">var</span> sections = [<span class="hljs-type">Section</span>]()
</code></pre>
<p>The next step is to pass the data from <code>ViewController</code> to <code>CustomCell</code>. For that we create a variable inside <code>CustomCell</code> which will receive the data for each section: </p>
<pre><code class="lang-swift"> <span class="hljs-keyword">var</span> section : <span class="hljs-type">Section?</span>{
        <span class="hljs-keyword">didSet</span>{
            <span class="hljs-built_in">print</span>(<span class="hljs-string">"section ✅"</span>,<span class="hljs-keyword">self</span>.section)
        }
    }
</code></pre>
<p>We use <code>cellForItemAt</code>  inside the <code>ViewController</code> method to pass the data directly to the <code>CustomCell</code> .</p>
<pre><code class="lang-swift"><span class="hljs-keyword">override</span> <span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-title">collectionView</span><span class="hljs-params">(<span class="hljs-number">_</span> collectionView: UICollectionView, cellForItemAt indexPath: IndexPath)</span></span> -&gt; <span class="hljs-type">UICollectionViewCell</span> {
        <span class="hljs-keyword">let</span> cell = collectionView.dequeueReusableCell(withReuseIdentifier: cellId, <span class="hljs-keyword">for</span>: indexPath) <span class="hljs-keyword">as</span>! <span class="hljs-type">CustomCell</span>

        cell.section = sections[indexPath.item]

        <span class="hljs-keyword">return</span> cell
    }
</code></pre>
<p>Note: we always call <strong><code>self</code></strong><code>.collectionView.reloadData()</code> every-time <code>fetchJson</code> is called so the block below, inside <code>CustomCell</code>, will be called as well. Check the console, <code>shift</code> + command + C:</p>
<pre><code class="lang-swift"> <span class="hljs-keyword">var</span> section : <span class="hljs-type">Section?</span> {
        <span class="hljs-keyword">didSet</span>{
            <span class="hljs-built_in">print</span>(<span class="hljs-string">"section ✅"</span>,<span class="hljs-keyword">self</span>.section)
        }
    }
</code></pre>
<p>The first thing we change is to set the the section title:</p>
<pre><code class="lang-swift"> <span class="hljs-keyword">var</span> section : <span class="hljs-type">Section?</span> {
        <span class="hljs-keyword">didSet</span>{
            <span class="hljs-built_in">print</span>(<span class="hljs-string">"section ✅"</span>,<span class="hljs-keyword">self</span>.section)
            <span class="hljs-keyword">guard</span> <span class="hljs-keyword">let</span> section = <span class="hljs-keyword">self</span>.section <span class="hljs-keyword">else</span> {<span class="hljs-keyword">return</span>}
            <span class="hljs-keyword">self</span>.titleLabel.text = section.title
        }
    }
</code></pre>
<p>And then you should see that each section has a specific title on the screen ?.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2019/12/Screen-Shot-2019-12-06-at-3.23.32-AM.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>Now it's time to pass the data down to <code>SubCustomCell</code>. We do the same thing as we did above. We need to pass the <code>playlists</code> array, so we create a variable named <code>playlists</code> inside <code>CustomCell</code>.</p>
<pre><code class="lang-swift"> <span class="hljs-keyword">var</span> playlists : [<span class="hljs-type">PlayList</span>]() <span class="hljs-comment">//empty</span>
</code></pre>
<p>First, we map through the <code>playlists</code>  from the <code>JSON</code>. Then we add each playlist with the <code>playlists</code> var.</p>
<pre><code class="lang-swift"> <span class="hljs-keyword">var</span> section : <span class="hljs-type">Section?</span> {
        <span class="hljs-keyword">didSet</span>{
            <span class="hljs-built_in">print</span>(<span class="hljs-string">"section ✅"</span>,<span class="hljs-keyword">self</span>.section)
            <span class="hljs-keyword">guard</span> <span class="hljs-keyword">let</span> section = <span class="hljs-keyword">self</span>.section <span class="hljs-keyword">else</span> {<span class="hljs-keyword">return</span>}
            <span class="hljs-keyword">self</span>.titleLabel.text = section.title
            <span class="hljs-comment">// append to playlists array</span>
             <span class="hljs-keyword">self</span>.section?.playlists.forEach({ (item) <span class="hljs-keyword">in</span>
                <span class="hljs-keyword">let</span> playlist = <span class="hljs-type">PlayList</span>(dictionary: item <span class="hljs-keyword">as</span>! [<span class="hljs-type">String</span> : <span class="hljs-type">Any</span>])
                <span class="hljs-keyword">self</span>.playlists.append(playlist)

            })
            <span class="hljs-keyword">self</span>.collectionView.reloadData()
        }
    }
</code></pre>
<p>Attention! If you try to run the app it may crash. This is because we forgot to set the number of sections. Since we are now receiving the data from JSON, the number should be dynamic based on the number of sections we have. The number of sections should be equal to the number of sections inside the <code>JSON</code>, so we need to modify <code>numberOfItemsInSection</code> inside <code>ViewController</code> to the below :</p>
<pre><code class="lang-swift">   <span class="hljs-keyword">override</span> <span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-title">collectionView</span><span class="hljs-params">(<span class="hljs-number">_</span> collectionView: UICollectionView, numberOfItemsInSection section: Int)</span></span> -&gt; <span class="hljs-type">Int</span> {
        <span class="hljs-keyword">return</span> sections.<span class="hljs-built_in">count</span>
    }
</code></pre>
<p>We do the same thing with the same method inside <code>CustomCell.swift</code> – but here we consider the number of the <code>playlists</code> instead.</p>
<pre><code class="lang-swift"><span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-title">collectionView</span><span class="hljs-params">(<span class="hljs-number">_</span> collectionView: UICollectionView, numberOfItemsInSection section: Int)</span></span> -&gt; <span class="hljs-type">Int</span> {
        <span class="hljs-keyword">return</span>  <span class="hljs-keyword">self</span>.playlists.<span class="hljs-built_in">count</span>
    }
</code></pre>
<p>The last step we have to complete is to pass each single playlist <code>Object</code> to <code>SubCustomCell</code> within <code>cellForItemAt</code> in <code>CustomCell.swift</code>. </p>
<pre><code class="lang-swift"> <span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-title">collectionView</span><span class="hljs-params">(<span class="hljs-number">_</span> collectionView: UICollectionView, cellForItemAt indexPath: IndexPath)</span></span> -&gt; <span class="hljs-type">UICollectionViewCell</span> {
        <span class="hljs-keyword">let</span> cell = collectionView.dequeueReusableCell(withReuseIdentifier: cellId, <span class="hljs-keyword">for</span>: indexPath) <span class="hljs-keyword">as</span>! <span class="hljs-type">SubCustomCell</span>
        <span class="hljs-comment">// here ?</span>
        cell.playlist = playlists[indexPath.item]
        <span class="hljs-keyword">return</span> cell
    }
</code></pre>
<p>And we are going to get that data inside <code>SubCustomCell</code> via the <code>playlist</code> variable and finally display the title and image of the playlist.</p>
<pre><code class="lang-swift"><span class="hljs-keyword">var</span> playlist : <span class="hljs-type">PlayList?</span> {
           <span class="hljs-keyword">didSet</span>{
               <span class="hljs-built_in">print</span>(<span class="hljs-string">"Playlist ?"</span>,<span class="hljs-keyword">self</span>.playlist)
            <span class="hljs-keyword">guard</span> <span class="hljs-keyword">let</span> playlist = <span class="hljs-keyword">self</span>.playlist <span class="hljs-keyword">else</span> {<span class="hljs-keyword">return</span>}
            <span class="hljs-comment">// The Image ?</span>
            <span class="hljs-keyword">self</span>.<span class="hljs-type">ImageView</span>.image = <span class="hljs-type">UIImage</span>(named: playlist.image)
            <span class="hljs-comment">// the playlist title ?</span>
            <span class="hljs-keyword">self</span>.<span class="hljs-type">TitleLabel</span>.text = <span class="hljs-keyword">self</span>.playlist?.title

           }
       }
</code></pre>
<p>I think everything should work fine now, just as below ?</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2019/12/demo3.gif" alt="Image" width="600" height="400" loading="lazy"></p>
<p> One last update to the UI: we have to add some padding and margins to the <code>section</code>  and <code>playlist</code> titles and make the playlist a little bit smaller.</p>
<p>Let's first add some padding for the section titles. To do that, we need just to give the <code>constant</code> property some number value inside the section cell <code>CustomCell</code> and within <code>setupSubCells</code>: </p>
<pre><code class="lang-swift"> collectionView.topAnchor.constraint(equalTo: titleLabel.bottomAnchor,constant: <span class="hljs-number">15</span>).isActive = <span class="hljs-literal">true</span>
</code></pre>
<p>And if you see the entire <code>collectionView</code> come in at the bottom of the <code>titleLabel</code>, all we need to do is add more space by adding <code>15</code>:</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2019/12/paddingForTitles-1.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>Next we come to the title of the <code>playlist</code>. This will be inside <code>SubCustomCell</code>, and we just need to add more space at the bottom of the ImageView.</p>
<pre><code class="lang-swift"> <span class="hljs-type">ImageView</span>.bottomAnchor.constraint(equalTo: <span class="hljs-type">TitleLabel</span>.topAnchor,constant: -<span class="hljs-number">15</span>).isActive = <span class="hljs-literal">true</span>
</code></pre>
<p>We already have the constant there. In order for it to work, the value should be <code>-15</code></p>
<p><img src="https://www.freecodecamp.org/news/content/images/2019/12/demo4.gif" alt="Image" width="600" height="400" loading="lazy"></p>
<p>Finally the playlist needs to be a little bit smaller. This is easy: we just make the <code>playlist</code> cell's height and width equal to the <code>section</code> cell's height divided by 2, just like below:</p>
<p><code>CustomCell.swift</code></p>
<pre><code class="lang-swift"> <span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-title">collectionView</span><span class="hljs-params">(<span class="hljs-number">_</span> collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath)</span></span> -&gt; <span class="hljs-type">CGSize</span> {

        <span class="hljs-keyword">let</span> width = frame.height / <span class="hljs-number">2</span>
        <span class="hljs-keyword">let</span> height = frame.height / <span class="hljs-number">2</span>

        <span class="hljs-keyword">return</span> <span class="hljs-type">CGSize</span>(width: width, height: height)

    }
</code></pre>
<p>Make the ImageView's height equal to <code>150</code> as well.</p>
<pre><code class="lang-swift">  <span class="hljs-comment">//SubCutomCell.swift</span>
  <span class="hljs-type">ImageView</span>.heightAnchor.constraint(equalToConstant: <span class="hljs-number">150</span>).isActive = <span class="hljs-literal">true</span>
</code></pre>
<p>And here we go ?.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2019/12/Screen-Shot-2019-12-09-at-9.55.19-PM.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>Perfect! I think that's enough for today – I don't want to make this article too long. So we will have another part where we will add the <code>TabBar</code> and the description, as well as some icons for the playlist.</p>
<p><strong>View the</strong> <a target="_blank" href="https://github.com/hayanisaid/autoLayout-programmatically-in-swift"><strong>Full source code on GitHub</strong></a><strong>?.</strong></p>
<p>Thanks for your time. I hope I haven't missed anything. If I did please @mention me on <a target="_blank" href="https://twitter.com/SaidHYN">Twitter</a>, or if you have any questions or an addition to this post the doors are always open to anyone. Thanks??.</p>
<p><strong><a target="_blank" href="https://webege.us16.list-manage.com/subscribe?u=311846a57d1e1a666287ad128&amp;id=2b386b2ebb">Subscribe</a></strong> <em>to my email list to be notified when the third part of this tutorial is published.</em> </p>
<blockquote>
<p>By the way, I’ve recently worked with a strong group of software engineers for one of my mobile applications. The organization was great, and the product was delivered very quickly, much faster than other firms and freelancers I’ve worked with, and I think I can honestly recommend them for other projects out there. Shoot me an email if you want to get in touch — <a target="_blank" href="mailto:said@devsdata.com">said@devsdata.com</a>.</p>
</blockquote>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ How Apple Pay Works Under the Hood ]]>
                </title>
                <description>
                    <![CDATA[ By Dumindu Buddhika Do you use Apple Pay? Have you ever wondered how an Apple Pay transaction goes through? In this post, you will learn how Apple Pay works end to end. Mobile payments have become very popular due to the convenience and the security ... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/how-apple-pay-works-under-the-hood-8c3978238324/</link>
                <guid isPermaLink="false">66c34cd10fa3812cdd5ea9e6</guid>
                
                    <category>
                        <![CDATA[ Apple ]]>
                    </category>
                
                    <category>
                        <![CDATA[ iphone ]]>
                    </category>
                
                    <category>
                        <![CDATA[ mobile ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Security ]]>
                    </category>
                
                    <category>
                        <![CDATA[ tech  ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ freeCodeCamp ]]>
                </dc:creator>
                <pubDate>Mon, 07 May 2018 06:29:56 +0000</pubDate>
                <media:content url="https://cdn-media-1.freecodecamp.org/images/1*Zsr_ysZ5bNXXnzdC0LHY6w.jpeg" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>By Dumindu Buddhika</p>
<p>Do you use Apple Pay? Have you ever wondered how an Apple Pay transaction goes through? In this post, you will learn how Apple Pay works end to end.</p>
<p>Mobile payments have become very popular due to the convenience and the security they offer. No more plastic cards to carry around, and you do not have to worry about losing them (what a relief!).</p>
<p>In this article, I am going to discuss how Apple Pay works in general and how it works when it is used at a physical POS terminal, specifically. I’ll briefly discuss the security benefits as well.</p>
<p>Before diving in, let’s get familiar with some basic terminology.</p>
<h4 id="heading-secure-element">Secure Element</h4>
<p>A secure element (SE) is something that is mentioned when talking about Apple Pay, so we need to understand what it is.</p>
<p>According to <a target="_blank" href="https://www.globalplatform.org/mediaguideSE.asp">Global Platform</a>:</p>
<blockquote>
<p>A Secure Element (SE) is a tamper-resistant platform (typically a one chip secure microcontroller) capable of securely hosting applications and their confidential and cryptographic data (e.g. key management) in accordance with the rules and security requirements set forth by a set of well-identified trusted authorities.</p>
</blockquote>
<p>Apple Pay uses SE to store secret information associated with tokenized cards (we will talk about this later).</p>
<p>In the iPhones after iPhone 6, and in Apple Watch, an SE is embedded into the device’s near-field communication (NFC) chip. This is used at payment terminals to perform transactions over NFC. SE emulates a payment card during an Apple Pay transaction.</p>
<h4 id="heading-tokenization">Tokenization</h4>
<p>Tokenization as a process is being adopted more and more in the payments industry. Here we’ll try to understand the basics of Tokenization.</p>
<p>The following is a concise description from Wikipedia on Tokenization technology:</p>
<blockquote>
<p><strong>Tokenization</strong>, when applied to data security, is the process of substituting a sensitive data element with a non-sensitive equivalent, referred to as a token, that has no extrinsic or exploitable meaning or value. The token is a reference (i.e. identifier) that maps back to the sensitive data through a tokenization system. The mapping from original data to a token uses methods which render tokens infeasible to reverse in the absence of the tokenization system</p>
</blockquote>
<p>In the context of credit cards and Apple Pay, <strong>tokenization</strong> is used to replace the Primary Account Number (PAN, or the credit card number) with a token. A token looks like a normal credit card number, but it’s not the original PAN. Tokenization stops the original card number from being used during transactions.</p>
<p>Tokens have no meaning by themselves and are worthless to criminals if a token is stolen. There is no algorithm to derive the Primary Account Number if you have a token. This makes it impossible for criminals to reverse engineer the Primary Account Number from a token.</p>
<p>Click <a target="_blank" href="https://en.wikipedia.org/wiki/Tokenization">here</a> for the Wikipedia article on tokenization if you want to learn more.</p>
<p>The following diagram describes the transaction flow of Apple Pay. We will discuss these step by step in the coming sections.</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/Tvs9gM2jDlgnFkUqWnw7f7bE1YG4DsYEsJah" alt="Image" width="613" height="518" loading="lazy">
<em>ymedialabs.com</em></p>
<h3 id="heading-adding-a-card-to-apple-pay">Adding a Card to Apple Pay</h3>
<p><img src="https://cdn-media-1.freecodecamp.org/images/C4FQQR5WKo8KpyiLxfG3tvmsLRwiaOv6h5ny" alt="Image" width="274" height="396" loading="lazy">
_[http://www.iphoneincanada.ca](http://www.iphoneincanada.ca" rel="noopener" target="<em>blank" title=")</em></p>
<p>A card can be added to Apple Pay by either scanning the card or by submitting the card information. Then this information is submitted to Apple servers.</p>
<p>Apple sends the received card information to the relevant card network (Visa, MasterCard, AmericanExpress, Discover, and so on). Then the card network validates the card information with the issuing bank.</p>
<p>After the validation, the card network acting as a <a target="_blank" href="https://www.slideshare.net/bellidcom/what-is-a-token-service-provider-52887269">TSP</a> (Token Service Provider) creates a token (which is called a DAN or a Device Account Number in the context of Apple Pay) and a token key. This DAN is generated using tokenization and is not the actual card number.</p>
<p>Afterward, this information is sent back to Apple servers. After the device receives this information from Apple servers, it is saved in the device’s secure element (SE).</p>
<h3 id="heading-initiating-a-transaction-using-apple-pay">Initiating a Transaction Using Apple Pay</h3>
<p><img src="https://cdn-media-1.freecodecamp.org/images/fzP2zrOr4FBQoNSAervf20OXqrWoeIHJhZHi" alt="Image" width="154" height="313" loading="lazy">
<em>support.apple.com</em></p>
<p>When you use your Apple device at a POS terminal to make a payment, the device communicates with the terminal to initiate a transaction. Apple Pay uses EMVCO’s <a target="_blank" href="https://www.emvco.com/emv-technologies/contactless/">contactless specification</a> to communicate with the terminal. If the terminal does not support EMV contactless, Apple Pay falls back to use contactless MSD (magnetic stripe data) mode.</p>
<h4 id="heading-emv-contactless-mode">EMV Contactless mode</h4>
<p>When EMV contactless mode is used, the Apple device communicates with the terminal according to the EMV contactless <a target="_blank" href="https://www.emvco.com/emv-technologies/contactless/">specification</a>. The secure element on the device generates a <strong>dynamic cryptogram</strong> for each transaction using the token, token key, amount, and other information related to the transaction. This dynamic cryptogram is then sent to the payment processor along with the token (DAN), transaction amount, and other required information to process the transaction.</p>
<h4 id="heading-contactless-msd-mode">Contactless MSD mode</h4>
<p>Contactless MSD exists to support terminals which are still not able to process using EMV contactless mode. Most of the terminals are still operating using contactless MSD mode. Let’s take a deeper look at how a transaction goes through using contactless MSD mode.</p>
<p>MSD, or Magnetic Stripe Data, is how older cards store card details. Data is stored as <strong>tracks</strong> in magnetic stripe cards. Magnetic stripe cards can have up to 3 tracks, and each track (track1, track2, track3) has a different format. Please click <a target="_blank" href="https://en.wikipedia.org/wiki/ISO/IEC_7813">here</a> for additional information on track data.</p>
<p>In Apple Pay contactless MSD mode, the track2 data format is used to transfer the card data to the payment processor which then communicates with the card network.</p>
<p>Let’s take a look at some example track data sent from a terminal to the processor for an Apple Pay transaction.</p>
<p>370295292756481=220672716078290600047</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/06Uue0GUDG01OBeKpoIeOHee0WRnfRdPm-mP" alt="Image" width="313" height="23" loading="lazy"></p>
<p>Above is an example of track data received from a terminal which was captured at a payment gateway.</p>
<p>Let’s understand this data segment by segment,</p>
<ul>
<li>Highlighted in yellow - This is the Device Account Number or the DAN (The example DAN here is from an AmericanExpress card. You can validate the bank identification number (BIN), or initial 6 digits in the credit card number, <a target="_blank" href="https://www.bincodes.com/bin-checker/">here</a>).</li>
<li>Highlighted in blue - This is the credit card expiry year and month(yy/mm)</li>
<li>Highlighted in pink - This is the service code. Click <a target="_blank" href="https://atlassian.idtechproducts.com/confluence/display/KB/Credit+Card+Service+Code+Chart++">here</a> to understand more about this.</li>
<li>Highlighted in purple - This part of data is discretionary to the card network. In case of Apple Pay, this is used as a <strong>dynamic card verification value (CVV).</strong></li>
</ul>
<p>We learned that in the EMV mode a <strong>dynamic cryptogram</strong> is generated. Here the <strong>dynamic CVV</strong> plays the role of the cryptogram. This is generated using the token key and other transaction-related data (similar to the generation of a <strong>dynamic cryptogram</strong>).</p>
<p>The track data shown above is sent to the <a target="_blank" href="https://en.wikipedia.org/wiki/Acquiring_bank">acquirer</a> along with the transaction amount. The acquirer forwards this information to the relevant card network (Visa, MasterCard, and so on ) based on the <a target="_blank" href="https://www.investopedia.com/terms/b/bank-identification-number.asp">BIN</a>.</p>
<h3 id="heading-completion-of-an-apple-pay-transaction">Completion of an Apple Pay Transaction</h3>
<p>When the card network receives the transaction request, it identifies whether it’s an actual card number or a tokenized card number. If it is tokenized (which is the case for Apple Pay transactions), the card network validates the cryptogram (or dynamic CVV) using their copy of the <strong>token key</strong> (the card network is acting as a <a target="_blank" href="https://www.slideshare.net/bellidcom/what-is-a-token-service-provider-52887269">TSP</a> here).</p>
<p>After some other additional validations, the card network de-tokenizes the DAN and obtains the original PAN (primary account number).</p>
<p>This transaction request is sent to the <a target="_blank" href="https://www.thebalance.com/credit-card-issuer-959984">issuer</a> (the bank or the financial institution who issued the credit card) along with the original PAN. The issuer authorizes the transaction and sends back the response which eventually reaches the POS terminal.</p>
<p>Yay! Transaction complete!</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/QLw4aphNtbO5blklWMB-m9S2UsU5XWY7d63z" alt="Image" width="160" height="326" loading="lazy">
<em>support.apple.com</em></p>
<h3 id="heading-replaying-transaction-requests">Replaying Transaction Requests</h3>
<p>One of the biggest problems with the traditional card transactions is the ability to replay past transaction requests (<a target="_blank" href="https://en.wikipedia.org/wiki/Replay_attack">replay attack</a>). If you resend the same transaction request, another transaction would be done with the same data.</p>
<p>With Apple Pay, this does not happen (also when using EMV cards directly on the terminal as well). Every transaction request can only be used once. The dynamic cryptogram (dynamic CVV in MSD mode) ensures this. For each transaction, a new cryptogram is generated which can only be used once (and is only valid for a certain time period).</p>
<h3 id="heading-conclusion">Conclusion</h3>
<p>In this article, we have gone through an overview of the Apple Pay transaction flow. I will discuss Google Pay in a coming article.</p>
<h4 id="heading-references">References</h4>
<ul>
<li><a target="_blank" href="http://www.gmarwaha.com/blog/2015/01/03/apple-pay-an-attempt-to-demystify-take-2/">http://www.gmarwaha.com/blog/2015/01/03/apple-pay-an-attempt-to-demystify-take-2/</a></li>
<li><a target="_blank" href="https://www.emvco.com/emv-technologies/contactless/">https://www.emvco.com/emv-technologies/contactless/</a></li>
<li><a target="_blank" href="http://msrtron.com/blog-headlines/blog-card-data">http://msrtron.com/blog-headlines/blog-card-data</a></li>
<li><a target="_blank" href="https://www.slideshare.net/bellidcom/what-is-a-token-service-provider-52887269">https://www.slideshare.net/bellidcom/what-is-a-token-service-provider-52887269</a></li>
</ul>
<h4 id="heading-before-you-go">Before you go!</h4>
<p>If you have enjoyed this article, claps are welcome!</p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ Bad artists copy, great artists steal—or, how to become a great designer ]]>
                </title>
                <description>
                    <![CDATA[ By Teo Yu Siang At Mobile World Congress 2018, something strange and interesting happened. No, I’m not talking about Samsung’s new S9 and S9+ phones (though they are interesting, all right). I’m referring to the weird phenomenon of Android phone make... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/bad-artists-copy-great-artists-steal-or-how-to-become-a-great-designer-a9d0c8aeade1/</link>
                <guid isPermaLink="false">66c3454652e2abc555bfcc0c</guid>
                
                    <category>
                        <![CDATA[ Design ]]>
                    </category>
                
                    <category>
                        <![CDATA[ iphone ]]>
                    </category>
                
                    <category>
                        <![CDATA[ tech  ]]>
                    </category>
                
                    <category>
                        <![CDATA[ technology ]]>
                    </category>
                
                    <category>
                        <![CDATA[ UX ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ freeCodeCamp ]]>
                </dc:creator>
                <pubDate>Fri, 16 Mar 2018 07:18:46 +0000</pubDate>
                <media:content url="https://cdn-media-1.freecodecamp.org/images/1*eIYZszZe_D9gQV8GCOedfA.png" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>By Teo Yu Siang</p>
<p>At Mobile World Congress 2018, something strange and interesting happened. No, I’m not talking about Samsung’s new S9 and S9+ phones (though they are interesting, all right).</p>
<p>I’m referring to the weird phenomenon of Android phone makers copying one of the iPhone X’s worst features—its <a target="_blank" href="https://www.tomsguide.com/us/iphone-x-notch-design,news-26020.html">wildly</a> <a target="_blank" href="https://mashable.com/2017/10/31/iphone-x-notch-different/#ACTV6hDxFsqg">controversial</a> notch.</p>
<p>To provide some background, the iPhone X, released in late 2017, features an all-screen design except for a notch, a cut-out at the top of the screen, that houses all the sensors required for FaceID, its new facial authentication method.</p>
<p>At its worst, the notch represents a <a target="_blank" href="https://medium.freecodecamp.org/all-2017-flagship-phones-have-glaring-compromises-heres-what-they-tell-us-about-design-6a9ba6d8bbd0">compromise</a> that Apple took in its attempt to push for an all-screen design while requiring a set of sensors for facial authentication.</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/wsBgMr8-iIDQLpUkVPa8V7q6Xc5vBnqgYOU7" alt="Image" width="800" height="364" loading="lazy">
<em>iPhone X’s notch houses a whole array of sensors that enable FaceID</em></p>
<p>Many of the new Android phones released in MWC2018 (as well as those slated to be released later in the year) feature a notch at the top of their screens. Asus’ <a target="_blank" href="https://www.cnet.com/news/asus-zenfone-5-is-an-iphone-x-on-the-cheap-mwc-2018/">Zenfone 5</a>, Huawei’s <a target="_blank" href="https://www.techradar.com/news/huawei-p20-and-p20-lite-caught-on-camera-with-iphone-x-like-designs">P20</a>, Oppo’s <a target="_blank" href="https://www.gizmochina.com/2018/03/05/oppo-r15-r15-dream-mirror-edition-official-page-appears-reservations-begin-likely-debut-soon/">R15</a>, and Ulefone’s <a target="_blank" href="http://ulefone.com/page-mwc2018.html">T2 Pro</a> all seemed to have jumped on the bandwagon and decided on a top-notch design. Heck, even LG’s rumoured G7 is <a target="_blank" href="https://www.cnet.com/news/lg-g7-renders-notch/">likely to feature</a> a cut-out at the top of its screen.</p>
<p>If you need more proof that notches are going to be a thing in Android smartphones, look no further than Android P’s beta, which has now <a target="_blank" href="https://www.engadget.com/2018/03/07/google-android-p-developer-beta-preview/">added</a> official support for displays with a cutout at the top.</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/HaxZlJo5o2RylBM2QORVzxYTR7KCdNi1lLww" alt="Image" width="800" height="126" loading="lazy"></p>
<p>The worst part? None of these phones house additional sensors in their notches to offer accurate facial recognition. In other words, these notches are purely cosmetic copies of the iPhone X’s design.</p>
<p>This brings to mind a quote popularised by Steve Jobs:</p>
<blockquote>
<p>Good artists copy, great artists steal.</p>
</blockquote>
<p>To which I would like to make the following amendment, if just to add a little dramatic flair:</p>
<blockquote>
<p>Bad artists copy, great artists steal</p>
</blockquote>
<h3 id="heading-the-difference-between-copying-and-stealing">The difference between copying and stealing</h3>
<p>So what’s the difference between copying and stealing? After all, both acts sound equally unethical.</p>
<p>To understand this often-repeated quote, let’s trace it back to one of its earliest sources. In 1920, the famous poet T. S. Eliot made this <a target="_blank" href="https://quoteinvestigator.com/2013/03/06/artists-steal/">remark</a> in an essay on poetry:</p>
<blockquote>
<p><strong>Immature poets imitate; mature poets steal;</strong> bad poets deface what they take, and good poets make it into something better, or at least something different. The good poet welds his theft into a whole of feeling which is unique, utterly different from that from which it was torn; the bad poet throws it into something which has no cohesion.</p>
</blockquote>
<p>In other words, the difference is in the <strong>intent</strong>.</p>
<p>When you <em>copy</em> something, you’re imitating its features for the sake of creating resemblance. On the other hand, when a thief breaks into your home, he/she doesn’t steal the floor mat. Your floor mat is worthless. <em>The thief steals your jewelry.</em></p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/DylxYOjRaMxiOiYNGykYOgyMKpARWgr49p5H" alt="Image" width="800" height="294" loading="lazy">
<em>Copying is mindless and is about creating resemblance; stealing is done with intent and recognizes the value of something else</em></p>
<p><strong>Stealing happens when you recognise the value in something, and apply it to your designs.</strong> It’s done with intention, with the purpose of making your design even better than it was. And most times, stealing also comes with the <em>improvement</em> of that which you’ve stolen, if only to make it fit perfectly within the context of your own designs.</p>
<h3 id="heading-dont-copy-steal">Don’t copy. Steal.</h3>
<p><em>Copying</em> is when Asus, Huawei, and Ulefone looked at the iPhone X and decided that their new flagships would also come with a notch at the top of their screens.</p>
<p><em>Copying</em> is when Samsung observed Apple’s Animoji—a feature Apple built into the iPhone X to make its new 3D facial recognition technology seem friendly and fun—and decided to build its own <a target="_blank" href="https://techcrunch.com/2018/02/25/samsungs-ar-emoji-taps-creepy-avatars-and-disney-characters-to-compete-with-animoji/">AR Emoji</a> despite the fact that the S9 lacks sensors to track 3D movement in real time.</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/gYiwCtWY9zQGoHqohOFOiJGLS9yTJ6O9cQt8" alt="Image" width="800" height="437" loading="lazy">
_Apple’s Animoji humanises facial recognition, a potentially scary piece of technology ([source](https://giphy.com/gifs/producthunt-apple-event-animated-emoji-3ohhwJ2v6v1bHegoKY" rel="noopener" target="<em>blank" title="))</em></p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/Kb0I2SK42pswr-QuII6tozkmiwlnxXiOtH5T" alt="Image" width="600" height="311" loading="lazy">
_Samsung’s version is… a little less refined ([source](https://youtu.be/8GdA4z9G4Qg" rel="noopener" target="<em>blank" title="))</em></p>
<p><em>Stealing</em>, on the other hand, is when Google realized the <em>value</em> of using a two-lens camera system to simulate the shallow depth of field effect found in professional SLR cameras. Google then went ahead and improved it after <a target="_blank" href="https://research.googleblog.com/2017/10/portrait-mode-on-pixel-2-and-pixel-2-xl.html">realizing</a> that it could recreate the effect of having two lenses by using minuscule differences in the <em>two halves of each pixel</em> captured on a single lens. Thus, the Pixel 2 and 2XL phones have just one camera, but with the help of a superior algorithm they’re able to reproduce simulated depth of field photos.</p>
<p><em>Stealing</em> is when Apple saw the promise of the Kinect’s 3D motion-sensing technology and decided to <a target="_blank" href="https://www.theverge.com/circuitbreaker/2017/9/17/16315510/iphone-x-notch-kinect-apple-primesense-microsoft">incorporate</a> an improved version of that technology into the iPhone X to enable accurate 3D facial recognition.</p>
<p><em>Stealing</em> is also when Japanese train designers saw the aerodynamic superiority of birds’ smooth beaks, and decided to <a target="_blank" href="https://99percentinvisible.org/article/biomimicry-designers-learning-natural-world/">apply</a> this feature to create faster and quieter bullet trains.</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/9XWmi4AjCOUnFeOhqMgNX5B7kmcFd3zM0pL5" alt="Image" width="800" height="214" loading="lazy"></p>
<p><strong>So don’t copy — steal.</strong></p>
<p>Don’t blindly emulate design patterns just because they worked for a product or service. See the value of what was done—understand the reasons for its success—and then think about how you can improve it when you apply it to your designs.</p>
<p>This way, you can become a great designer. Because you’re not just throwing a copied feature into your product. Instead, you’re adding value and making an idea your own. And this way, your inspirations will come not just from designs you find in your industry—they’ll come from everywhere.</p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ The iPhone X’s TrueDepth IR Camera: A Universe of Possibilities Beyond Animojis and Face ID ]]>
                </title>
                <description>
                    <![CDATA[ By James Hsu More than two months after the iPhone X launch, it remains a conundrum for some to put a finger on exactly which features might justify the $1000+ price Apple has given its flagship phone. Some might wager on the virtually edge-to-edge O... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/the-iphone-xs-truedepth-ir-camera-a-universe-of-possibilities-beyond-animojis-and-face-id-ebcb5d2a7aca/</link>
                <guid isPermaLink="false">66c361960cede4e9b1329cd7</guid>
                
                    <category>
                        <![CDATA[ Apple ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Apps ]]>
                    </category>
                
                    <category>
                        <![CDATA[ gaming ]]>
                    </category>
                
                    <category>
                        <![CDATA[ iphone ]]>
                    </category>
                
                    <category>
                        <![CDATA[ vr ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ freeCodeCamp ]]>
                </dc:creator>
                <pubDate>Wed, 17 Jan 2018 18:44:28 +0000</pubDate>
                <media:content url="https://cdn-media-1.freecodecamp.org/images/1*_-KvUHk8nytLHenewH4OpA.png" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>By James Hsu</p>
<p>More than two months after the iPhone X launch, it remains a conundrum for some to put a finger on exactly which features might justify the $1000+ price Apple has given its flagship phone.</p>
<p>Some might wager on the virtually edge-to-edge OLED display, which for the first time on an iPhone, does away with the tactile home button and prominent top and bottom bezels of every previous model. It is admittedly <em>gorgeous</em>.</p>
<p>As it turns out, however, the iPhone X’s most groundbreaking feature is not even discernible at first glance, even though it literally stares you in the face.</p>
<h3 id="heading-meet-the-truedepth-ir-camera">Meet the TrueDepth IR Camera</h3>
<p>Apple has been <a target="_blank" href="https://www.theguardian.com/technology/2014/may/30/pressure-tim-cook-innovation-apple">dogged by perceptions</a> that the company’s product roadmap has grown conservative and predictable in the six years following Steve Jobs’ passing. The new TrueDepth IR camera, as Apple calls the iPhone X’s secondary front-facing camera, could well help Apple dispel those rumors of complacency.</p>
<p>New to the iPhone X and housed in the black notch at the top of the display, the technology includes a number of high tech components such as a “flood illuminator,” infrared (IR) camera, and an infrared emitter. The latter emits 30,000 infrared dots in a known pattern when a face is detected, enabling the iPhone X to generate a 3D map of a user’s face. Notably, the TrueDepth IR camera can do this fast enough to support the creation of 3D motion data as well.</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/xWH-g4d72HOuN1iNNBR9ySWUM3xKbCIL8t2E" alt="Image" width="800" height="571" loading="lazy">
<em>TrueDepth IR can create a 3D map of your face using an infrared camera and emitter. (Photo credit: Apple)</em></p>
<h4 id="heading-at-present-there-are-currently-two-supported-use-cases-for-the-new-truedepth-ir-camera-on-the-iphone-x"><strong>At present, there are currently two supported use cases for the new TrueDepth IR camera on the iPhone X:</strong></h4>
<ul>
<li><strong>Animoji</strong>, or animated emoji — the camera animates a 3D emoji with your captured facial expressions, which you can then send via Messenger or SMS.</li>
<li><strong>Face ID</strong> — the camera uses a locally stored 3D image of your face to authenticate and unlock your iPhone X. Because it uses 3D image data, it’s much harder to trick than previous mobile face recognition systems that used a 2D image and therefore could be fooled with a photo.</li>
</ul>
<p><img src="https://cdn-media-1.freecodecamp.org/images/yt6UE8WcjrPLl9-Nmrxx5rA77cWOtSK40vNK" alt="Image" width="511" height="279" loading="lazy">
<em>Animojis are certainly fun, but they only scratch the surface of what’s possible. (Photo credit: Apple)</em></p>
<h3 id="heading-what-thats-it">“What — that’s it?”</h3>
<p>Admittedly, the <em>current</em> use cases for this technology are limited.</p>
<p>Animoji are just emoji with a fun twist, and unlocking phones hasn’t exactly been a pain point for modern smartphone users, with the prevalence of fingerprint sensors on many phones and pattern drawing as an adequate secondary option.</p>
<p>What’s incredibly intriguing is that the TrueDepth IR camera technology can and will have much stronger applications in the very near future. As with the iPhone’s previous Touch ID (fingerprint sensor), an iOS SDK makes it easy for app developers to use Face ID and the TrueDepth IR camera for a myriad of other more compelling use cases. In fact, Face ID uses the exact same API as Touch ID, making implementation into mobile apps incredibly simple.</p>
<p>Here are some of the areas where the TrueDepth IR camera could spawn useful or interesting mobile applications:</p>
<h3 id="heading-financial-services-and-internet-banking">Financial Services and Internet Banking</h3>
<p>For more than a decade, the gold standard in Internet banking authentication has been two-factor authentication. One of the most common forms of two-factor authentication has involved sending a verification code sent to your phone or email address, which must then be manually entered along with your password to access your account.</p>
<p>In the past few years, mobile banking apps have been quick to add support for fingerprint-based authentication. This has made it easier than ever to access your bank accounts online using your mobile phone. For the banks, this means customers have easier access to their services, resulting in increased revenues.</p>
<p>Why, given the already enhanced convenience of fingerprint-based authentication, would banks care about implementing face recognition into their mobile apps? To understand why, let’s consider false positive rates — the rate at which any given authentication protocol provides a false authentication. Apple claims that Touch ID, its fingerprint based authentication, has a false positive rate of 1 in 50,000. Compare that to the chance of guessing a four-digit PIN, 1 in 10,000.</p>
<p>Now, let’s look at the iPhone X’s new Face ID feature. Apple claims Face ID has a false positive rate of approximately 1 in 1,000,000. <em>If true, this represents a 20-fold improvement in accuracy compared to fingerprint based authentication and 100-fold improvement over a four-digit PIN.</em></p>
<p>That’s sure to get the attention of the banks offering Internet banking, as well as of the consumers who also benefit from enhanced fraud protection. In fact, many banks have already implemented Face ID support into their iOS apps. Chase, for example, <a target="_blank" href="https://media.chase.com/content/pr/chase-mobile-app-introduces-face-id">added Face ID support within two weeks of the iPhone X’s launch</a>.</p>
<h3 id="heading-entertainment-and-fun">Entertainment and Fun</h3>
<p>iOS 11 introduced <a target="_blank" href="https://developer.apple.com/arkit/">ARKit</a>, a new framework that allows developers to easily create unparalleled augmented reality experiences for iPhone and iPad. Combined with the iPhone X’s TrueDepth IR camera, ARKit opens up a revolutionary capability for robust face tracking across multiple app categories.</p>
<p>Imagine:</p>
<ul>
<li>Entering the character creation screen for Assassin’s Creed: Identity and being able to not only choose your assassin’s class but also their visual identity, using your own face in place of the default character model’s</li>
<li>Having a more accurate view of a prospective match’s face before you choose to swipe left or swipe right on Tinder, Bumble, or POF</li>
<li>Being able to skip a trip to Sephora or ULTA and experiment with new makeup without shelling out for everything up front</li>
</ul>
<p>A few years ago, virtual reality (VR) technology was in the same place that the technology behind TrueDepth IR is now: a promising technology needing stronger applications in video games and entertainment.</p>
<p>Oculus, a virtual reality company, was founded in 2012 and ran a successful Kickstarter campaign that year, raising $2.5 million. Just two years later in 2014, Oculus was acquired by Facebook for <em>$2 billion</em>, or nearly one thousand times the initial financing round. Could companies that invest in entertainment applications using TrueDepth IR technology find a similar trajectory?</p>
<p>There are already precedents in the space, too. Two years ago — when face tracking was still based on two-dimensional images — <a target="_blank" href="http://www.latimes.com/business/technology/la-fi-tn-facebook-masquerade-20160309-snap-story.html">Facebook purchased (for an undisclosed amount) Masquerade</a>, a startup whose MSQRD app lets users create self-altered images and video using face tracking technology.</p>
<h3 id="heading-medical-and-fitness">Medical and Fitness</h3>
<p>Imagine being able to have a medical examination at any hour of the day, on-demand, from the convenience of your bed, sofa, or office chair. With the help of the iPhone X’s TrueDepth IR camera, this could become a reality.</p>
<p>TrueDepth IR technology has the potential to be used for medical imaging, because it can create detailed 3D maps of your face, including the surface of your skin. Notably, it can also capture 3D movement, including subtle changes in facial expression.</p>
<p>Consider the following potential medical use cases:</p>
<ul>
<li>Have a dermatologist examine an abnormal skin growth, with the ability to rotate the image for a better look at the structure of a potential tumor, for example.</li>
<li>Have your phone automatically alert you when it notices facial cues or subtle movements that could be associated with the onset of a stroke, seizure, or heart attack.</li>
<li>For recovering stroke patients, you might have an app that tracks any muscular degeneration over time and provides your doctors with this detailed 3D image data on demand.</li>
</ul>
<p>While these use cases would certainly not replace the need to have in-person examinations, regular screening via phone camera could play a supporting role in enabling early detection or regular monitoring of known medical conditions.</p>
<p>Consider also that Apple has published a software development kit (SDK) called Apple Healthkit, which allows app developers API access to rich health and fitness information across a variety of sources: fitness wearables, health devices, and software applications. New or updated mobile apps might combine health vitals from Apple Healthkit with 3D facial image data to offer a more complete assessment of users’ health or fitness.</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/Mooi2Z13sH3d4RBGrqMZgH8fyq6vtM-Qwv9p" alt="Image" width="800" height="571" loading="lazy">
<em>Apple Healthkit integrations will allow TrueDepth IR to be used for health and fitness assessments. (Photo credit: Apple)</em></p>
<h3 id="heading-the-future-is-here">The Future is Here</h3>
<p>The iPhone X is the first phone to offer depth-sensing IR cameras, but it certainly won’t be the last.</p>
<p>“With the wide spectrum of new use cases that the technology makes possible, the impetus is now on software developers and bold businesses to bring these applications to life,” said Harry Lee, CEO of <a target="_blank" href="https://citrusbits.com/">CitrusBits</a>. Based in Los Angeles and San Francisco, CitrusBits is a mobile app development agency that designs and develops award-winning mobile apps for some of the world’s best known brands, including Burger King, Symantec, and Quiksilver.</p>
<p>“Those that do embrace the technology now can enjoy first mover advantages such as the ability to build a sizable market share and enjoy strong network effects that discourage future market entrants — not to mention the opportunity to get bought up by Facebook, Microsoft, or another titan of industry,” Lee explains.</p>
<p>To see more stories like this one, subscribe to CitrusBits’ newsletter, <a target="_blank" href="http://eepurl.com/dhLqQ9">Bits &amp; Bytes</a>.</p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ How to Use SnapKit to Write Constraints Programmatically for iOS Apps ]]>
                </title>
                <description>
                    <![CDATA[ By Jake Shelley When I first started building apps with Xcode, I thought Storyboards were magic. Dragging and dropping subviews into place was so simple, I never understood how people built views without them. Eventually, I decided that to become a “... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/how-to-use-snapkit-to-write-constraints-programmatically-for-ios-apps-ce0a6d9e76cf/</link>
                <guid isPermaLink="false">66d45f35052ad259f07e4ae4</guid>
                
                    <category>
                        <![CDATA[ iOS ]]>
                    </category>
                
                    <category>
                        <![CDATA[ iphone ]]>
                    </category>
                
                    <category>
                        <![CDATA[ mobile app development ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Swift ]]>
                    </category>
                
                    <category>
                        <![CDATA[ tech  ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ freeCodeCamp ]]>
                </dc:creator>
                <pubDate>Sun, 14 Jan 2018 21:13:53 +0000</pubDate>
                <media:content url="https://cdn-media-1.freecodecamp.org/images/1*mLxT0gEiltVrN8rS_zKLWg.jpeg" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>By Jake Shelley</p>
<p>When I first started building apps with Xcode, I thought Storyboards were magic. Dragging and dropping subviews into place was so simple, I never understood how people built views without them.</p>
<p>Eventually, I decided that to become a “master programmer,” I would need to learn how to construct views programmatically. One problem, writing constraints in code is a pain.</p>
<pre><code><span class="hljs-keyword">let</span> horizontalConstraint = NSLayoutConstraint(   item: newView,    <span class="hljs-attr">attribute</span>: NSLayoutAttribute.centerX,    <span class="hljs-attr">relatedBy</span>: NSLayoutRelation.equal,    <span class="hljs-attr">toItem</span>: view,    <span class="hljs-attr">attribute</span>: NSLayoutAttribute.centerX, <span class="hljs-attr">multiplier</span>: <span class="hljs-number">1</span>, <span class="hljs-attr">constant</span>: <span class="hljs-number">0</span>)
</code></pre><p>That’s a horizontal constraint that will center a subview on the X axis of its superview. Not so easy to read not to mention writing that for every constraint gets old fast. Still, I wanted to ditch storyboards so I searched for an alternative. That’s when I found <a target="_blank" href="http://github.com/SnapKit/SnapKit">SnapKit</a>.</p>
<p>SnapKit has a clear and concise API that makes writing constraints in the code a breeze. I’m going to go through a few really basic examples of what can be done in SnapKit.</p>
<p>I’ll be going over:</p>
<ol>
<li><strong>Laying out a subview in its superview</strong></li>
<li><strong>Laying out subviews relative to each other</strong></li>
<li><strong>Updating and animating constraints</strong></li>
</ol>
<h4 id="heading-getting-started">Getting started</h4>
<p>Make sure you download SnapKit in your project. I use <a target="_blank" href="http://cocoapods.org/">Cocoapods</a> for 3rd party libraries.</p>
<p>Add <code>pod 'SnapKit'</code> to your Podfile and run <code>pod install</code>. Now write <code>import SnapKit</code> at the top of the file you want to use it in.</p>
<h4 id="heading-laying-out-a-subview-in-its-superview">Laying out a subview in its superview</h4>
<p>First off I’ll pin a subview to the edges of its superview:</p>
<pre><code><span class="hljs-keyword">let</span> subview = UIView()view.addSubview(subview)
</code></pre><pre><code>subview.snp.makeConstraints { (make) <span class="hljs-keyword">in</span>    make.top.equalTo(view)    make.bottom.equalTo(view)    make.left.equalTo(view)    make.right.equalTo(view)}
</code></pre><p>This will set constraints for the top, bottom, left, and right edges of the subview to the corresponding edges of its superview with a constant of 0.</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/6yjMwrwbqTmK5U3NaVcIAByRqmnbomeAXIqO" alt="Image" width="320" height="570" loading="lazy">
<em>The subview pinned to its superview’s edges with a constant of 0</em></p>
<p>Notice that I add the subview to the superview before I setting the subview’s constraints. If you write constraints for views that aren’t already added to the superview, it will throw a fatal runtime error when the view loads.</p>
<p>The SnapKit syntax is already a lot more readable than the standard library but it can be shortened. SnapKit provides an even more concise way to constrain a view to the edges of its superview:</p>
<pre><code><span class="hljs-keyword">let</span> subview = UIView()view.addSubview(subview)
</code></pre><pre><code>subview.snp.makeConstraints { (make) <span class="hljs-keyword">in</span>    make.top.bottom.left.right.equalTo(view)}
</code></pre><p>This will layout my subview the same way as the code above, but with one line instead of four.</p>
<p>I can also constrain the size of my subview. Below, I’m going to set the height and width of the subview and set it to the center of its superview:</p>
<pre><code>subview.snp.makeConstraints { (make) <span class="hljs-keyword">in</span>    make.width.equalTo(<span class="hljs-number">200</span>)    make.height.equalTo(<span class="hljs-number">200</span>)    make.centerX.equalTo(view)    make.centerY.equalTo(view)}
</code></pre><p><img src="https://cdn-media-1.freecodecamp.org/images/1iMgmnVQPYYYmiv9mn7NWSe8sxRWAmsmuuMp" alt="Image" width="320" height="570" loading="lazy"></p>
<p>That example is pretty simple, but I repeated myself a lot. When setting constraints that have the same values, SnapKit allows me to chain constraints together like so:</p>
<pre><code>subview.snp.makeConstraints { (make) <span class="hljs-keyword">in</span>    make.width.height.equalTo(<span class="hljs-number">200</span>)    make.centerX.centerY.equalTo(view)}
</code></pre><p>This block will result in the same constraints as the one above. Just another way SnapKit helps to write cleaner code.</p>
<h4 id="heading-laying-out-subviews-relative-to-each-other">Laying out subviews relative to each other</h4>
<p>When adding many subviews to a single view, it’s likely that you’ll want to layout subviews in relation to each other. In this example, I will:</p>
<ol>
<li>Add <code>subview1</code> and constrain it to the left edge its superview</li>
<li>Add <code>subview2</code> and constrain it to the right edge of the <code>subview1</code></li>
</ol>
<pre><code><span class="hljs-keyword">let</span> subview1 = UIView()<span class="hljs-keyword">let</span> subview2 = UIView()view.addSubview(subview1)view.addSubview(subview2)
</code></pre><pre><code>subview1.snp.makeConstraints { (make) <span class="hljs-keyword">in</span>    make.width.height.equalTo(<span class="hljs-number">100</span>)    make.left.equalTo(view)}
</code></pre><pre><code>subview2.snp.makeConstraints { (make) <span class="hljs-keyword">in</span>    make.width.height.equalTo(subview1)    make.left.equalTo(subview1.snp.right)}
</code></pre><p>Up until now, I’ve wanted my constraints to be equal to the corresponding constraint for the relative view. For example, in <code>make.left.equalTo(view)</code>SnapKit sets the <code>left</code> of <code>subview1</code> to the <code>left</code> of <code>view</code>. SnapKit will automatically match the constraint I set if I do not specify otherwise.</p>
<p>For the <code>left</code> constraint of <code>subview2</code>, I want to set it to the <code>right</code> edge of <code>subview1</code>. If I wrote <code>make.left.equalTo(subview1)</code> SnapKit would set the <code>left</code> edge of <code>subview2</code> to the <code>left</code> edge of <code>subview1</code>. Instead, I use the <code>right</code> edge of <code>subview1</code> which I grab by writing <code>subview1.snp.right</code>.</p>
<p>I can access any constraint of a view’s layout by adding <code>snp</code> as seen above.</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/-eQjim0SnilZW2c4hsPgWQomS2TOoC44bzkt" alt="Image" width="320" height="570" loading="lazy">
<em>subview 2 is constrained to the right of subview 1 with a constant of 0</em></p>
<p>Now that I have <code>subview2</code> to the right of <code>subview1</code>, I’ll create some space between them by adding an <strong>offset</strong> to <code>subview2</code>.</p>
<pre><code>subview2.snp.makeConstraints { (make) <span class="hljs-keyword">in</span>    make.width.height.equalTo(subview1)    make.left.equalTo(subview1.snp.right).offset(<span class="hljs-number">50</span>)}
</code></pre><p>An offset can be appended at the end of any <code>equalTo()</code> to change the constant of that constraint. Now <code>subview2</code> will have a constant of 50 on its <code>left</code>constraint.</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/12PDwNisgHOscWhDRBx45lwmW5ysGD-6D7Am" alt="Image" width="320" height="570" loading="lazy">
<em>subview 2 is now constrained to subview 1 with a constant of 50</em></p>
<h4 id="heading-updating-and-animating-constraints">Updating and animating constraints</h4>
<p>If you want your app to be the #NextBigThing everyone knows you’ll need to add a little flair! SnapKit provides a way to easily update constraints to create dynamic views.</p>
<p>Updating a constraint with SnapKit is almost identical to adding a new one. Here, I’ll update the constraint for <code>subview1</code> from the previous example by changing the <code>left</code> edge constraint’s constant from 0 to 50:</p>
<pre><code>subview1.snp.updateConstraints { (make) <span class="hljs-keyword">in</span>   make.left.equalTo(<span class="hljs-number">50</span>)}
</code></pre><p>And that’s it! My subview will update to the new constraints when the code block is run.</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/iY07Gepf4N4TE7b3iRQ-FEy-S8CZgoPklpMO" alt="Image" width="320" height="570" loading="lazy">
<em>Clicking the button updates subview1’s constraints</em></p>
<p>You probably noticed that <code>subview2</code> moved when I updated <code>subview1</code> even though I didn’t update its constraints.<code>subview2</code> is constrained to the right edge of <code>subview1</code>. When <code>subview1</code> gets moved, <code>subview2</code> will continue to honor the left constraint it has with <code>subview1</code>.</p>
<p>Now I’ll add an animation to smooth out the transition. If you’ve ever animated a view before, this syntax will be familiar:</p>
<pre><code>UIView.animate(withDuration: <span class="hljs-number">0.3</span>) {    subview1.snp.updateConstraints { (make) <span class="hljs-keyword">in</span>        make.left.equalTo(<span class="hljs-number">50</span>)    }        self.view.layoutIfNeeded()}
</code></pre><p>When animating updates on my constraints, I need to call <code>layoutIfNeeded()</code>on the subview’s parent. If I’m animating more than one view at once, I will need to call <code>layoutIfNeeded()</code> on the subview’s closest common superview.</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/sYlCU5J2zYlN5if4W5au2V8RMVkrWwj6Hj4Z" alt="Image" width="320" height="570" loading="lazy"></p>
<p><code>updateConstraints()</code> can only update existing constraints. Attempting to update a constraint that isn’t already in place will result in a fatal run time error.</p>
<p>If you want to add new constraints to your subview, use <code>remakeConstraints()</code>. <code>**remakeConstraints()**</code> <strong>will remove any existing constraints you have set on that subview</strong> and allow you to add new ones.</p>
<p>You can also use <code>deactivate()</code> to remove a constraint. Below I create, set, and them remove a constraint using <code>deactivate()</code>:</p>
<pre><code><span class="hljs-keyword">var</span> constraint: Constraint!<span class="hljs-keyword">let</span> subview = UIView()
</code></pre><pre><code>subview.snp.makeConstraints { (make) <span class="hljs-keyword">in</span>    constraint = make.height.equalTo(<span class="hljs-number">100</span>).constraint}
</code></pre><pre><code>constraint.deactivate()
</code></pre><p>You can also animate the removal of a constraint by deactivating it inside of an animation block.</p>
<p>So now you are a master of writing constraints programmatically. Storyboards seem like a joke now and there’s no reason to ever go back to them, right?</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/RrxxmZ0RENDVaxHMS4-fBOJoeB7xGJF1OIQ8" alt="Image" width="800" height="533" loading="lazy">
<em>How it feels building storyboards after reading this guide</em></p>
<p>Not really. Storyboards and nibs are still the fastest way to put together a view controller, and, if you are working with non-developers, they are the best way to show what the app will look like without sending a beta version.</p>
<p>Personally, I use both. In <a target="_blank" href="https://github.com/JakeShelley1/Todo-List-App-Swift/">the last app I built</a>, I added constraints both in code with SnapKit and using Auto Layout on storyboards and nibs, sometimes on the same view. In the end, you’ll have to decide which works best for the view you are building.</p>
<p><em>Thanks so much for reading! If you liked this story, follow me on <a target="_blank" href="https://twitter.com/JakeShelley3">Twitter</a> where I post articles about product management, engineering, and design.</em></p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ Reverse-Engineering the iPhone X Home Indicator Color ]]>
                </title>
                <description>
                    <![CDATA[ By Nathan Gitter I noticed an unusual behavior of the iPhone X home indicator while working on my most recent app. The app’s background near the home indicator is purple. When the app launches, the home indicator is very light gray. But something odd... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/reverse-engineering-the-iphone-x-home-indicator-color-a4c112f84d34/</link>
                <guid isPermaLink="false">66c35e04add0807b8e3fb912</guid>
                
                    <category>
                        <![CDATA[ Apple ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Design ]]>
                    </category>
                
                    <category>
                        <![CDATA[ iOS ]]>
                    </category>
                
                    <category>
                        <![CDATA[ iphone ]]>
                    </category>
                
                    <category>
                        <![CDATA[ mobile app development ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ freeCodeCamp ]]>
                </dc:creator>
                <pubDate>Fri, 29 Dec 2017 16:28:10 +0000</pubDate>
                <media:content url="https://cdn-media-1.freecodecamp.org/images/1*KdedwHiZuQFXgq1pDSKYtg.png" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>By Nathan Gitter</p>
<p>I noticed an unusual behavior of the iPhone X home indicator while working on <a target="_blank" href="https://itunes.apple.com/app/id1312458558">my most recent app</a>. The app’s background near the home indicator is purple. When the app launches, the home indicator is very light gray.</p>
<p>But something odd happened when I pressed the app’s “share” button, which opened a default iOS activity view (aka “share sheet”). When I hit the “cancel” button to close the activity view, the home indicator animated to a dark gray color.</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/PW1Sp7y3-Uyx8KotWbJmY3vLxeYbgTzQ1vnD" alt="Image" width="600" height="150" loading="lazy">
<em>Home indicator starts light, then a share sheet passing makes it dark.</em></p>
<p>Even though the background color was exactly the same, the light-colored activity view passing underneath caused the home indicator to change color. The only way to get the home indicator back to its original color was to leave the app and come back.</p>
<p>I had never seen this before, and it prompted my curiosity.</p>
<p>What determines the color of the home indicator and why it does it behave like this? The answer is surprisingly complex. Let’s take a deep dive and see what we can learn!</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/2BOISXO2zhsCXnfpgzLdSARUUYXPZ6xVW-i4" alt="Image" width="800" height="320" loading="lazy"></p>
<h3 id="heading-home-indicator-basics">Home Indicator Basics</h3>
<p>In September 2017, Apple introduced its newest iteration of mobile phone: iPhone X. The new design replaced the iconic home button with on-screen gestures. To go home, the user simply swipes up from the bottom of the screen.</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/HEVGYnljLUSkaodv3lCeOpTbrL2KjDG2xMd1" alt="Image" width="600" height="600" loading="lazy">
_[https://www.apple.com/iphone-x/](https://www.apple.com/iphone-x/" rel="noopener" target="<em>blank" title=")</em></p>
<h3 id="heading-the-home-indicators-purpose">The Home Indicator’s Purpose</h3>
<p>To create the affordance of being able to swipe up from the bottom of the screen, Apple added a small horizontal bar known as the home indicator. The home indicator is always present except for the home screen and in any apps that request it to be temporarily hidden (full-screen video, games, etc.).</p>
<p>The home indicator serves another purpose: protecting the bottom edge of the screen from conflicting user interface elements and gestures. Because the user needs to be able to swipe up from the bottom of the screen at any time, best practices now dictate that developers should avoid place conflicting gestures or buttons in the bottom edge of the display.</p>
<p>By placing a bar at the bottom, user interface elements in the same location <em>look wrong</em>—there’s a visual conflict between the bar and other elements. In this sense, the home indicator “protects” this region of the screen from designers or engineers that are unaware of the functionality of the iPhone X.</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/6agDeGHH86okGA0VTbuT0uz3kEETxOid-9wU" alt="Image" width="800" height="226" loading="lazy">
<em>It doesn’t take a UI designer to see something is wrong here.</em></p>
<p>Now that we’re all on the same page, let’s get back to our original question: “What color is the home indicator?”</p>
<h3 id="heading-part-1-the-beginning">Part 1 — The Beginning</h3>
<p>On September 13, 2017, I answered a <a target="_blank" href="https://stackoverflow.com/a/46199029/6658553">Stack Overflow question</a> asking how to change the color of the home indicator.</p>
<p>At the time, the iPhone X hadn’t been publicly released, but the latest version of Xcode included an iPhone X simulator. Running a simple test app in the simulator revealed that the home indicator’s color was based on the color of the content below it.</p>
<p>The new APIs for the iPhone X were released alongside this same version of Xcode, and there was no public API available to modify the color of the home indicator (which is still the case at the time of writing this post, and probably will always be the case).</p>
<p>This made my Stack Overflow answer simple and straightforward: it is not possible to modify the color, and you shouldn’t worry about it, since it’s out of your control and guaranteed to be visible.</p>
<p>Because I anticipated this to be a common question, I included some screenshots of the home indicator on top of various background colors.</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/yXawcigRDs6CVMWwxAd0IKe8x49OQF-QGkZf" alt="Image" width="800" height="510" loading="lazy">
<em>Some home indicator color examples from my Stack Overflow answer.</em></p>
<p>This was good enough for me. The home indicator maintains its visibility by sampling the color of the view below it, and picking a gray color that provides sufficient contrast.</p>
<h3 id="heading-part-2-the-plot-thickens">Part 2 — The Plot Thickens</h3>
<p>It turns out the home indicator’s color is not that simple. Some further observations poked holes into my “solid-color function” theory.</p>
<h4 id="heading-observation-1-multiple-colors">Observation #1: Multiple Colors</h4>
<p>The first observation is that the home indicator can have multiple colors, similar to a gradient. In the following example, the left side of the screen is black, and the right is white. The home indicator adjusts for this by adopting a lighter color over the dark background, and a darker color over the light background.</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/ZPnZJOn4nQERqdYWY6VJgNpyWiyJFnYJlWpY" alt="Image" width="800" height="253" loading="lazy">
<em>If you look close enough, you can see the transition from gray to black. (iOS simulator)</em></p>
<p>The home indicator can be multiple colors at the same time, and smoothly transitions between them. This smooth transition is updated in real time if any of the views behind the home indicator change.</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/FYSsLMxrGG4qlvA8--O8VV9lrxLg2du9uIci" alt="Image" width="512" height="72" loading="lazy">
<em>Watch the home indicator’s color change as the white view passes underneath. (iOS simulator)</em></p>
<p>In the example above, a small white view is moving back and forth behind the home indicator. The section of the home indicator that covers the white view becomes pure black and smoothly transitions to gray.</p>
<p>This behavior is similar to a <code>UIVisualEffectView</code>, which applies a blur over existing content. The home indicator is most likely taking a sample of the nearby colors in order to get the blend effect seen in the image above.</p>
<p>(Besides looking good, this functionality might help prevent burn-in on the OLED display.)</p>
<h4 id="heading-observation-2-same-background-different-home-indicator-color">Observation #2: Same Background, Different Home Indicator Color</h4>
<p>As I mentioned at the beginning of this post, I noticed an unusual behavior when a share sheet passed beneath the home indicator.</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/GGyUjxfDNqAOskn7c6BGRxtesu7hqrmoFn6I" alt="Image" width="600" height="150" loading="lazy">
<em>Home indicator starts light, share sheet passing makes it dark. (real iPhone X)</em></p>
<p>This was the most surprising observation — there is not a simple 1-to-1 mapping between background colors and home indicator colors. At this point I was determined to learn more via experimentation.</p>
<h3 id="heading-part-3-the-investigation-begins">Part 3 — The Investigation Begins</h3>
<p>My first order of business was to determine the formula for the home indicator color on the iOS simulator. From my previous observations, the iOS simulator’s behavior was more predictable than a real device.</p>
<p>I created a new iOS app as a laboratory for my future experiements. The app was simple—all I needed was an easy way to change the background color behind the home indicator. A slider and stepper control the background color’s gray value, which is displayed as a large number in the center of the screen.</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/nWzohviurK21h8OI5HAW1lK2j5-hZ2Y4Pxpc" alt="Image" width="800" height="645" loading="lazy">
<em>The app created for testing the home indicator.</em></p>
<p>My goal was to determine the home indicator color for every possible gray background color. I could graph this data and see if a formula applied to it. Since there were only 256 possibilities, I took the manual approach, using macOS’s built-in “Digital Color Meter” app to get the home indicator color for each value.</p>
<p>I graphed the results. It was not a linear function, an exponential function, or any kind of “nice” function you might see in math class.</p>
<p>The graph was … odd.</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/EiCAcdHy9JjQ18UrUYZYFrxasQjZFldP1ocb" alt="Image" width="800" height="518" loading="lazy"></p>
<p>This was not what I was expecting.</p>
<p>It was a step function but with uneven steps. It had a few distinct sections: a period of (relatively) light gray, two big steps, a series of small steps, steps in the reverse direction, and a period of pure black.</p>
<p>The most unusual part was that the home indicator color was not always decreasing. There was a period (around rgb 170–190) where it became lighter as the background became lighter.</p>
<p>Why did the graph look like this? What would the same experiment have similar results on a real device? I needed to know.</p>
<h3 id="heading-part-4-the-investigation-continues">Part 4 — The Investigation Continues</h3>
<p>My next task was to perform the same experiment on a real device. It was immediately obvious that the results were going to be dramatically different.</p>
<p>To collect data on a real device, I used the same app from before. I streamed a live preview of the iPhone screen to my computer via QuickTime. This removed any discoloration from the True Tone display, as well as allowed me to use the Digital Color Meter app to easily inspect the colors.</p>
<p>Another factor added to the complexity on a real device—the red, green, and blue values were not always the same. On the simulator, the RGB values were identical, resulting in colors like RGB(54, 54, 54). On a real device, they were almost never the same, but were very close, resulting in colors like RGB(211, 209, 212). When recording the results, I took the average of the individual RGB values.</p>
<p>Here are the results, compared with the previous simulator data.</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/hPXJsKb9awbYEJ3YQTY0dbtRGmJ9EmFLhMk6" alt="Image" width="800" height="518" loading="lazy"></p>
<p>The colors on a real device (red line) follow a similar trend to those on the simulator (blue line), except offset by a significant margin. The simulator home indicator is always very dark, while the device home indicator is either very light or very dark.</p>
<p>The graph for the real device is noisy. Overall it follows a smooth trend, but jumps up and down and looks rough. This is more than just a side-effect of my averaging, and the noise is consistent. If the experiment is repeated, the noise follows the exact same pattern.</p>
<p>However, the graph above doesn’t tell the whole story.</p>
<p>The values presented above were gathered by starting the background completely black and incrementing the RGB values one at a time (going from 0 to 255). <strong>When the values are gathered in the opposite direction, the results are different.</strong></p>
<p>At a certain point, the home indicator color “falls off the cliff” in its transition from light to dark or dark to light, and animates for a brief period of time, as shown in the previous gif with the purple background color. Depending on whether the background starts light or dark, the cliff occurs in a different place.</p>
<p>Let’s take a look at a new graph comparing the results from “going up” (black to white) and “going down” (white to black).</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/adFEPIdfwqPFvZB4ShWxXVXbb3F2o4focA9E" alt="Image" width="800" height="510" loading="lazy"></p>
<p>The blue line above is the same as the previous graph’s red line. Its data points were collected left to right (0 to 255, “going up”). The orange line is the same data, but collected in the opposite direction (255 to 0, “going down”). The red line represents the points where the home indicator and the view background are the same color.</p>
<p>The “going up” and “going down” lines follow a similar path, but have a different noise pattern. Interestingly, they have the exact same noise pattern in the darkest range (0–80).</p>
<p>From this graph we can tell that the “cliffs” occur when the color of the home indicator is coming too close to the color of the background. It even appears as if the “going up” and “going down” lines are being pushed away by the red line, actively trying to resist becoming exactly the same color as the background. At a certain point, the home indicator flips to being very dark or very light.</p>
<p>This explains the shift in color in the app with the purple background. The purple color must be in a region between the two cliffs. Based on the previous color of the home indicator, it could either be light or dark. When the white activity view animates behind the home indicator as it is dismissed, the home indicator transitions from its light state to its dark state, and re-settles at the dark-equivelevnt value for the purple background color.</p>
<h3 id="heading-part-5-the-investigation-becomes-colorful">Part 5 — The Investigation Becomes Colorful</h3>
<p>All the tests up to this point have used grayscale backgrounds. How would the results differ if we used colored backgrounds instead?</p>
<p>I repeated the same experiment, but instead of modifying the gray color, I modified the hue on an HSB color scale. I kept the saturation (S) and brightness (B) at their maximum values to get the most vibrant and distinct colors. I only tested these colors “going up”, which in this case means from hue 0 (red) to hue 255 (red) in rainbow order.</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/mNmkHQrkvj5wMIK6Kp0EfYPBuo5zly9hjBik" alt="Image" width="800" height="488" loading="lazy"></p>
<p>The first observation is that there are two cliffs — once when the color becomes yellow, and again when the color becomes dark blue. This occurs because of the relative “brightness” of the colors.</p>
<p>The next observation is the difference between the simulator and a real device. The colors follow the same general trends, but the real device’s home indicator color is noisier and can reach brighter values.</p>
<p>These are fascinating findings so far. Aside from testing every possible background color, there’s not much else we can discover from observation alone. Now I was curious exactly how the home indicator is implemented—is it a <code>UIView</code>? <code>CALayer</code>? <code>UIVisualEffectView</code>? Something else? What is making it behave in this way?</p>
<p>Let’s find out.</p>
<h3 id="heading-part-6-we-need-to-go-deeper">Part 6 — We Need to Go Deeper!</h3>
<p>At this point I turned to my friend and <a target="_blank" href="https://twitter.com/ian_mcdowell">iOS expert Ian McDowell</a>. He was able to point me in the right direction—using the iPhone X Simulator and Xcode’s debugging tools to find the home indicator.</p>
<p>The iOS “home screen” is actually an app called SpringBoard. We can attach a debugger to the Springboard app running in the iPhone X simulator and use the “Debug View Hierarchy” option in order to inspect the views that make up the home screen, including the home indicator.</p>
<p>If you want to follow along at home, here is the process:</p>
<ol>
<li>Launch an iPhone X simulator.</li>
<li>In Xcode, select Debug &gt; Attach to Process… &gt; SpringBoard.</li>
<li>When SpringBoard is running, select the Debug View Heirarchy button.</li>
</ol>
<p>Deep in the view hierarchy we find an <code>MTLumaDodgePillView</code> which is a subview of an <code>SBHomeGrabberView</code>. Sounds like we found the home indicator!</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/dQxjnOKrUanJrQugTMg8Trr1QxSvDm9htka3" alt="Image" width="800" height="168" loading="lazy">
<em>We found the home indicator!</em></p>
<p>The name <code>MTLumaDodgePillView</code> makes sense. It confirms our observed behavior of the home indicator, that its color contrasts the background based on its current brightness.</p>
<p>Can we go deeper yet?</p>
<p>SpringBoard has another cool feature: a hidden debug menu. It turns out there’s an entire section for modifying properties of the home indicator. In this debug menu, the home indicator is called a “grabber”.</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/icEJTKHTlmST3Kg7FK8mPVHXTZGIkZBIvj8X" alt="Image" width="800" height="410" loading="lazy">
<em>So many fun sliders to play with. ?</em></p>
<p>This debug menu mainly contains visual and animation settings. It is most likely used to collaborate between design and engineering within Apple. Engineering builds the home indicator, provides hooks to all the internal parameters, lets designers fiddle with them until they are content, and then engineers use the settings for the final product.</p>
<p>Luckily for us, we can access this menu and see the results in the simulator.</p>
<p>I first played around with the visual appearance of the home indicator. There are sliders for the width and height in various states.</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/mC1yawDoCBeSgAN3nPmNfHtPpdXNIJf0JWfJ" alt="Image" width="800" height="681" loading="lazy">
<em>Some alternate home indicator sizes.</em></p>
<p>The other settings are more difficult to test, as they don’t seem to apply to the simulator. There are settings for a “luma threshold” for light and dark, as well as parameters for the animation between states. This confirms the “cliffs” where the color would dramatically animate between light and dark—there are pre-defined thresholds based on the luminosity of the background.</p>
<p>I was unable to determine why the simulator behaves so differently from a real device. My guess is that the simulator is using a different combination of settings, or that certain settings only take effect on real hardware.</p>
<p>Want to learn more about reverse engineering on iOS? Sash Zats posted <a target="_blank" href="http://blog.zats.io/2017/12/27/iPhone-X-home-button/">an amazing in-depth article about the home indicator</a>. Check it out if you want to dive into more code!</p>
<p>This marks the end of the adventure of home indicator discovery. I hope it was as educational for you as it was for me!</p>
<h3 id="heading-high-level-takeaways">High-level Takeaways</h3>
<ol>
<li>The home indicator’s color is determined by the system and cannot be modified directly.</li>
<li>The home indicator’s color is determined by the content underneath, and it is not always a solid color.</li>
<li>The home indicator on the simulator is <strong>not</strong> an accurate representation of the home indicator on a real device.</li>
<li>The home indicator animates to its new color(s) when the content underneath changes.</li>
<li>The home indicator is either in a “light” or “dark” state.</li>
</ol>
<h3 id="heading-but-why">But… Why?</h3>
<p>Why bother investigating the home indicator if its appearance is out of our control?</p>
<p>There is a practical application for these learnings: If a screen in your app has a background color in the middle range where the home indicator could be either light or dark, you may prefer one style over the other. If the status bar is white, for example, it may look more visually balanced if the home indicator is white as well. Being aware of the home indicator’s nuanced behavior can help ensure that it doesn’t accidentally animate between light and dark when it could be distracting to the user.</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/RA0vUMMWwxosnDxMxSGhLOsm3HXCD4OHckTZ" alt="Image" width="800" height="465" loading="lazy">
<em>Prefer one over the other?</em></p>
<p>In a previous example, the white share sheet animating behind the home indicator was enough to change the home indicator’s style.</p>
<p>If I wanted to prevent this, I could pin a view behind the home indicator between the safe area and the bottom edge of the display. When the share sheet is dismissed, I could give it a darker background color (maybe black with 40% alpha) and add a fade animation so it’s less noticeable.</p>
<p>This same tactic could be used to set the color of the home indicator—forcing it over one of the “cliffs”. In the vast majority of cases, the home indicator should be left alone to do what it wants. Most iPhone X users have probably already forgotten it’s even there.</p>
<h3 id="heading-the-real-lesson">The Real Lesson</h3>
<p>Hopefully this brief investigation into the color of the home indicator helps us appreciate the complexity of simple design. “It’s just a black/white bar!” is far from the truth. The amount of care and attention to detail that went into the home indicator is worth appreciating.</p>
<p>Taking something simple, investigating its internal complexities, and pondering its design helps us learn about the creative process. By combining design and engineering, we can make better products that are simple and delightful to use.</p>
<p>Enjoyed the story? Leave some claps ? here on Medium and share it with your iOS design/dev friends. Want to stay up-to-date on the latest in mobile app design/dev? Follow me on Twitter here: h<a target="_blank" href="https://twitter.com/nathangitter">ttps://twitter.com/nathangitter</a></p>
<p>Thanks to <a target="_blank" href="https://twitter.com/ian_mcdowell">Ian McDowell</a> and <a target="_blank" href="https://twitter.com/dokun24">David Okun</a> for helping revise previous drafts of this post.</p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ The Future of the iPhone X: From the Realistic to the Absurd ]]>
                </title>
                <description>
                    <![CDATA[ By benjamin bannister As a user and fan of the iPhone, I filmed a spoof video for an imaginary product called The iPhone X3. Let’s discuss the ideas presented in it, and explore the likelihood we’ll get these technologies in the future. Solar Chargin... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/the-future-of-the-iphone-x-from-the-realistic-to-the-absurd-f33bee3288ea/</link>
                <guid isPermaLink="false">66c361705c8b3e001e067e5f</guid>
                
                    <category>
                        <![CDATA[ Apple ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Design ]]>
                    </category>
                
                    <category>
                        <![CDATA[ iphone ]]>
                    </category>
                
                    <category>
                        <![CDATA[ startup ]]>
                    </category>
                
                    <category>
                        <![CDATA[ tech  ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ freeCodeCamp ]]>
                </dc:creator>
                <pubDate>Thu, 28 Sep 2017 14:30:09 +0000</pubDate>
                <media:content url="https://cdn-media-1.freecodecamp.org/images/1*QzmPP_NX-jthlR-bn4019w.png" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>By benjamin bannister</p>
<p>As a user and fan of the iPhone, I filmed a spoof video for an imaginary product called <a target="_blank" href="https://youtu.be/QRDl_UypTx4"><strong>The iPhone X3</strong></a><strong>.</strong></p>
<p>Let’s discuss the ideas presented in it, and explore the likelihood we’ll get these technologies in the future.</p>
<h3 id="heading-solar-charging">Solar Charging</h3>
<p>Wireless Qi charging is finally here on the newest iPhones! This would otherwise be impressive, had I not been jealous of my friend’s wireless charging Microsoft Lumia phone — half a decade ago.</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/1*lQx-2Pi3CNojzzpYd4P6XA.gif" alt="Image" width="480" height="270" loading="lazy">
_<strong>“Solar Charging”</strong> Image: [benjamin bannister](http://www.benjaminbannister.com/" rel="noopener" target="<em>blank" title=")</em></p>
<p>But what about the future of charging? What other power sources could we rely on? Something Apple, something technology forward.</p>
<p>What about solar energy? There are currently solar solutions like portable batteries, solar roofs, and solar panels.</p>
<p>The main hurdle behind solar is it’s not as efficient as we would like it to be. Harnessing the sun’s energy still has a ways to go. Also, the sun can’t be relied on 100% of the time, so if solar charging is implemented, it would have to be supplemental to whatever the main source of power is.</p>
<p><em>Technology forecast</em>: Until solar capturing efficiency is significantly increased along with miniaturizing it in a small form factor, we have a long wait for this.</p>
<h3 id="heading-wireless-transactions">Wireless Transactions</h3>
<p>In the video, a male character enters the New York City Subway by scanning his phone using NFC (near field communication) technology. He then proceeds to order movie tickets (to a fictional future “<em>The First Annual Hunger Games</em>” prequel/sequel), which Siri purchases automatically based on his buying habits.</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/1*IacDcIm-vmHAFa5iyBoFew.gif" alt="Image" width="480" height="270" loading="lazy">
_<strong>“Wireless Transactions”</strong> Image: [benjamin bannister](http://www.benjaminbannister.com/" rel="noopener" target="<em>blank" title=")</em></p>
<p>Surprisingly, the NYC Subway has yet to catch on to wireless transportation entry, while cities like London have had it for over a decade (using RFID).</p>
<p>NFC is already is here with Apple Pay with more and more vendors supporting it for purchases and transactions.</p>
<p><em>Technology forecast</em>: People are already using wireless transactions. It’s just a matter of implementation.</p>
<h3 id="heading-augmented-navigation">Augmented Navigation</h3>
<p>Apple Maps and Google Maps have increasingly gotten better over time. We’ve seen streamlined graphics, to satellite imagery, to knowing your location and orientation, to 3D mapping entire cities, to Street View, to choosing methods of transportation, to being able to choose departure and arrival times.</p>
<p>Imagine your phone showing a holographic projection in front of you that overlays your surroundings along with clear directions to guide you to your destination.</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/1*V5ESdz8vJ3r62W4pK8ocLA.gif" alt="Image" width="480" height="270" loading="lazy">
_<strong>“Augmented Navigation”</strong> Image: [benjamin bannister](http://www.benjaminbannister.com/" rel="noopener" target="<em>blank" title=")</em></p>
<p>We’ve seen this special effect in Hollywood movies, but never in real life. It can’t exist for the same reason lightsabers can’t exist: because you can’t just stop light in midair; it has to project onto some type of surface.</p>
<p><em>Technology forecast</em>: Improbable.</p>
<h3 id="heading-security-word">Security Word</h3>
<p>I had my phone stolen one time from a very bold pickpocket. It was in a crowded subway. I had a dark jacket on, with my iPhone in a bright orange case sticking out like one big target saying “steal me.” The subway came to a an abrupt stop and a guy pushed up against me a little <em>too</em> much. It was only when I went to reach for my phone later did I realize it was gone, and the guy that bumped into me was gone.</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/1*9MWPYesP4uNzrnxWNSBqDQ.gif" alt="Image" width="480" height="270" loading="lazy">
_<strong>“Security Word”</strong> Image: [benjamin bannister](http://www.benjaminbannister.com/" rel="noopener" target="<em>blank" title=")</em></p>
<p>It was at this moment I thought of a “Security Word” as a deterrence mechanism. Imagine saying a word or phrase matched to your voice which activates an electric shock to whoever has it. Imagine! “I know who the killer is! Let’s ring this phone and find out!”</p>
<p>This will never happen mainly because it can be used in ways that would stir up a whole bunch of lawsuits.</p>
<p><em>Technology forecast</em>: We <em>could</em> make a miniature taser, but <em>should</em> we put it into a phone?</p>
<h3 id="heading-projector">Projector</h3>
<p>In the video, we see a woman giving a presentation. We initially assume the projector feature is projecting the PowerPoint presentation behind her, but the twist is: <em>she’s</em> the projection.</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/1*T28AYx4_M4P77G0OCZyUZw.gif" alt="Image" width="480" height="270" loading="lazy">
_<strong>“Projector”</strong> Image: [benjamin bannister](http://www.benjaminbannister.com/" rel="noopener" target="<em>blank" title=")</em></p>
<p>This is an extension of the Augmented Navigation idea. Think of it as 3D Facetime. Again, while it’s nice to imagine, you still need to project light onto a surface.</p>
<p>Take something as cool as these Halloween projection effects. They all look awesome, but require a surface like a wall or a sheer curtain to be seen.</p>
<p>There are mini projector these days but they lack resolution and brightness.</p>
<p><em>Technology forecast</em>: Advances in projection technology could make this a reality some day. The only caveat is you need a surface to project your images on.</p>
<h3 id="heading-adaptive-liquidmetal-shell">Adaptive LiquidMetal Shell</h3>
<p>I was just having fun with this feature. Past news report that Apple bought an exclusive license to <a target="_blank" href="https://www.youtube.com/watch?v=RAQIioLteuM">Liquidmetal</a> technology. My guess is they did this so no one else would have it while testing the waters with what could be done with it. So far, only a SIM ejector pin has been made of it.</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/1*p_qvKm4JrwFYOSgsMtSzdw.gif" alt="Image" width="480" height="270" loading="lazy">
_<strong>“Adaptive LiquidMetal Shell”</strong> Image: [benjamin bannister](http://www.benjaminbannister.com/" rel="noopener" target="<em>blank" title=")</em></p>
<p>In the video, the LiquidMetal borders the entire phone and its color can be personalized in iOS based on your preference. This was purely fiction when I made it up, something I wanted, but not something I could see happening. The whole point of this segment was to allow customization.</p>
<p>How could this technically happen if it could? Maybe a screen that wraps around the phone, which lights up in a color of your choosing when there is a notification. Maybe color e-ink technology could be wrapped around the phone that would maintain its color while the main screen is off.</p>
<p><em>Technology forecast</em>: Possible, in the very distant future.</p>
<h3 id="heading-meow-to-unlock">Meow To Unlock©</h3>
<p>Apple likes to sell you on emotions. Does it make you smile? Does it delight?<em>Live Photos</em> (Harry Potter photos) are one such feature. I don’t know about you, but when I take the right Live Photo, I treasure it in my phone.</p>
<p>With the iPhone X, we have <em>Animojis</em>, animated emojis that can replicate our facial features onto an emoji, along with an audio recording of what we want to say. It seems… amusing, and the jury will be out until people have the iPhone X in their hands.</p>
<p>What else could Apple have done to make us smile? I decided everyone likes kittens, 98% of people do (I just made that statistic up). Instead of <em>numbers</em> to unlock our phones, why not have pictures of <em>cute kittens</em>? I’ll tell you now: all my friends want this feature.</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/1*hBB5nDIvcKBVnSUVohalcQ.gif" alt="Image" width="480" height="270" loading="lazy">
_<strong>“Meow to Unlock”©</strong> Image: [benjamin bannister](http://www.benjaminbannister.com/" rel="noopener" target="<em>blank" title=")</em></p>
<p>But wait! We now have facial unlocking. <em>However</em>, Apple still requires a 4–6 digit code from time to time as a backup to authenticate who you are.</p>
<p>Could they add an optional feature like picture unlock? Or a Meowcode© to unlock? It would only require a software update.</p>
<p><em>Technology forecast</em>: It’s highly unlikely Apple would implement this after they’ve stuck with numbers and now facial recognition to unlock your phone. But, if any other companies wants to license this idea from me…</p>
<p>That concludes my insights. Sometimes it takes visualizing an idea on screen to inspire someone to make it a reality.</p>
<p>Let me know your thoughts on the technology, and <a target="_blank" href="https://youtu.be/QRDl_UypTx4">The iPhone X3</a> video (give it a thumbs up on YouTube if you enjoyed it).</p>
<h3 id="heading-bonus-content-behind-the-scenes-storyboards">BONUS CONTENT: Behind-the-Scenes Storyboards</h3>
<p>Here are scans of the original storyboards used for filming. As with most things in life, most of the work is in the preparation and planning stages, while the easiest part is the execution.</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/1*Q51hhEOVdO267ii9qJqzjA.png" alt="Image" width="800" height="618" loading="lazy">
_<strong>“Solar Charging”</strong> Image: [benjamin bannister](http://benjaminbannister.com/" rel="noopener" target="<em>blank" title=")</em></p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/1*h6KbMoKG2jh5qlxr7E2D_A.png" alt="Image" width="800" height="618" loading="lazy">
_<strong>“Wireless Transactions”</strong> Image: [benjamin bannister](http://benjaminbannister.com/" rel="noopener" target="<em>blank" title=")</em></p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/1*ME_9T8TujIMVhblpxBDNAw.png" alt="Image" width="800" height="618" loading="lazy">
_<strong>“Augmented Navigation”</strong> Image: [benjamin bannister](http://benjaminbannister.com/" rel="noopener" target="<em>blank" title=")</em></p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/1*HetFb-d4QZ00Lt6QB35jUg.jpeg" alt="Image" width="800" height="465" loading="lazy">
_<strong>“Projector”</strong> Image: [benjamin bannister](http://benjaminbannister.com/" rel="noopener" target="<em>blank" title=")</em></p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/1*M64dYqkg3M1LNL0ccQn0wg.jpeg" alt="Image" width="800" height="618" loading="lazy">
_<strong>“Security Word”</strong> Image: [benjamin bannister](http://benjaminbannister.com/" rel="noopener" target="<em>blank" title=")</em></p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/1*vaLTbvJRBWMWeR6fWSLxaA.png" alt="Image" width="800" height="618" loading="lazy">
_<strong>“Adaptive LiquidMetal Shell”</strong> Image: [benjamin bannister](http://benjaminbannister.com/" rel="noopener" target="<em>blank" title=")</em></p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/1*5S2XFLZPMSTWqjvPebKXqw.png" alt="Image" width="800" height="618" loading="lazy">
_<strong>“Meow to Unlock”</strong> Image: [benjamin bannister](http://benjaminbannister.com/" rel="noopener" target="<em>blank" title=")</em></p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/1*cqdkl5Q3gqD29TLL-Jqg2g.png" alt="Image" width="800" height="618" loading="lazy">
_<strong>“[benjamin bannister](https://youtu.be/QRDl_UypTx4" rel="noopener" target="_blank" title=""&gt;The iPhone X3”</strong> Image: &lt;a href="http://benjaminbannister.com/" rel="noopener" target="<em>blank" title=")</em></p>
<blockquote>
<p>Show your support by clapping this article, tweeting it, sharing it, and follow me to discover new things.</p>
</blockquote>
<p><img src="https://cdn-media-1.freecodecamp.org/images/1*EiPW3Y4kKstQD7JZoM_dFw.png" alt="Image" width="800" height="376" loading="lazy">
_[<strong>benjaminbannister.com</strong>](http://www.benjaminbannister.com/" rel="noopener" target="<em>blank" title=")</em></p>
<p><strong>Also by benjamin bannister:</strong></p>
<ul>
<li><a target="_blank" href="https://medium.freecodecamp.org/seo-secrets-reverse-engineering-googles-algorithm-92fad4f5a39">SEO Secrets: Reverse-Engineering Google’s Algorithm</a></li>
<li><a target="_blank" href="https://medium.com/@benjaminbannister/macpad-pro-two-worlds-united-a8c6f4c51eb3">What Would an Apple MacPad Pro Look Like?</a></li>
<li><a target="_blank" href="https://medium.freecodecamp.com/why-typography-matters-especially-at-the-oscars-f7b00e202f22">Why Typography Matters — Especially At The Oscars</a></li>
</ul>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ Homeless iPhone (Part 2) ]]>
                </title>
                <description>
                    <![CDATA[ By Fabrice Dubois Pause. Rewind. Deep dive in the design process. Two weeks ago I posted about the possibility of an iPhone that has no Home button at all. With iOS 11 on an iPad you enjoy a whole new app switcher. As a little design challenge, I stu... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/homeless-iphone-part-2-1f7b3acc8a6c/</link>
                <guid isPermaLink="false">66c34c894f7405e6476b01cf</guid>
                
                    <category>
                        <![CDATA[ Apple ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Design ]]>
                    </category>
                
                    <category>
                        <![CDATA[ iphone ]]>
                    </category>
                
                    <category>
                        <![CDATA[ prototyping ]]>
                    </category>
                
                    <category>
                        <![CDATA[ user experience ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ freeCodeCamp ]]>
                </dc:creator>
                <pubDate>Thu, 24 Aug 2017 12:30:13 +0000</pubDate>
                <media:content url="https://cdn-media-1.freecodecamp.org/images/1*4Mvw-7X4soi0LMJnQyPbtg.png" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>By Fabrice Dubois</p>
<p><em>Pause. Rewind. Deep dive in the design process.</em></p>
<p>Two weeks ago I <a target="_blank" href="https://medium.freecodecamp.org/homeless-iphone-20c154fabbf7">posted about the possibility of an iPhone that has no Home button at all</a>.</p>
<p>With iOS 11 on an iPad you enjoy a whole new app switcher. As a little design challenge, I study how this UI could work on the imminent ‘iPhone 8’, and whether it could cater for the absence of Home button.</p>
<p>Today I’ve paused the exploration, and I’m walking you through the design process. We’ll review my sketches in detail, see what they reveal about the train of thought (<em>ouch!</em>), and look at a couple of prototype variants that you’ll be able to download and try.</p>
<blockquote>
<p>Being process-oriented, not product-driven, is the most important and difficult skill for a designer to develop.</p>
<p>Matthew Frederick</p>
</blockquote>
<p>Sketches and prototypes below are provided <em>as is</em>, they haven’t been modified at all for the sake of this article. I include raw scans of my large sketch boards, so the post is probably best viewed on desktop or tablet.</p>
<h3 id="heading-sketching">Sketching</h3>
<p>I always keep my sketches and notes. They’re useful to review in slow motion what has happened in the mind, assess the reasoning, and have a fresh look at germinating ideas that were forgotten on the road side.</p>
<p>For this project I used two A3 sheets. Let’s comment the key screens:</p>
<blockquote>
<p><strong><em>1.</em></strong> <strong><em>Trying to force-fit the iPad design.</em></strong> <em>In that first attempt, everything is on a single horizontal scroll view. And there’s a Home button! False start.</em></p>
<p><strong><em>2.</em></strong> <strong><em>Trying again.</em></strong> <em>But stopping fast since clearly, it’s not going to work. My proportions are completely unrealistic. Lack of discipline.</em></p>
<p><strong><em>3. A more realistic ratio</em></strong><em>. I finally acknowledge it’s a very long phone I’m dealing with (6/13 ratio). I’m going to need my imagination. The whole view now scrolls vertically, with apps on 2 columns. An accident happens here: my focus has now shifted to the iPhone’s Control Centre (that I’m probably examining on my iOS 11 phone, as a model for the sketch). I’m misled and add the little chevron at the top, meaning “swipe down to close”.</em></p>
</blockquote>
<p><img src="https://cdn-media-1.freecodecamp.org/images/KFPEoJsGeyiPVN4Dyv4UAYIV8mMH5Cxz4hp5" alt="Image" width="800" height="542" loading="lazy">
<em>Sheet 1 of 2</em></p>
<blockquote>
<p><strong><em>4.</em> <em>A potential conflict.</em></strong> <em>Because I now wrongly assume the UI can be swiped down, I worry this is going to interfere with my vertical scroll. I capture this in a side note: “KO since swipe needed to close overlay”. I swap things, move apps to the top, as if it could help, but finally plant the seed of an alternative idea: “Recent apps @ top but as horiz. carousel”.</em></p>
<p><strong><em>5.</em> <em>One last shot at the vertical scroll.</em></strong> <em>Here, I guess I’m seeking confirmation that the vertical approach is flawed... But my mind forks again as I notice a new issue! Controls and recent apps compete for visibility: Scroll to view one and the other is pushed out of bounds. They’re part of the same strap. At that point I decide to try decoupling them.</em></p>
</blockquote>
<p><img src="https://cdn-media-1.freecodecamp.org/images/bEdIEtTi3RKTZgHoeJwAVRerrDO18vy1pGKE" alt="Image" width="800" height="542" loading="lazy">
<em>Sheet 2 of 2</em></p>
<blockquote>
<p><strong><em>6. Recent apps as horizontal carousel.</em></strong> <em>That looks more familiar for an app switcher. Controls still scroll vertically, though — so how does that work as a whole? Doesn’t feel right. I appear distracted again between 6 and 7 but let’s skip that.</em></p>
<p><strong><em>7. Two parallel scroll views.</em></strong> <em>The control group and the app carousel are now free to move without running into each other. Space is shared equally. I annotate some elements with “Size?”: Can I afford that layout on the real device? Only one way to know: Increase fidelity. But overall I sense I’ve got a candidate solution I can work with.</em></p>
</blockquote>
<h3 id="heading-observations">Observations</h3>
<p><strong>I don’t state my goal</strong>. That’s a pity because something as simple as “Adapt the new iPad switcher to the iPhone 8” (even if obvious) would have focused me sooner on the actual issues.</p>
<p><strong>I don’t have a very clear logic in mind.</strong> Evidence of confusion: The fallacy that the UI is an overlay that can be swiped down, and the Home button that I remove then for some reason bring back (don’t ask!).</p>
<p><strong>I seem mainly concerned by a layout problem.</strong> Apparently I don’t worry much about how to access the home screen. Yet that’s very key in my experiment! I do leave a shy trace at step 3: “Lacks obvious way to go to HS”, and then stick a Home button everywhere. This is embarrassing (given the experiment is all about button-less!) — I’m probably aware that at some point I need to find empty space so the background can be tapped, like on the iPad switcher, but I wouldn’t swear. The Home button looks more like a mechanically applied FIX-ME label, something I don’t want to deal with yet.</p>
<blockquote>
<p>Being process-oriented means: [Long list that includes:] Working fluidly between concept-scale and detail-scale to see how each informs the other.</p>
<p>Matthew Frederick</p>
</blockquote>
<p><strong>My drawing and handwriting look awful.</strong> But somehow that’s positive. In the process of doing these sketches it never occurred to me that I would share them later; in the moment, the absence of aesthetic requirements actually <em>did</em> reinforce focus.</p>
<p><strong>Side notes help inform my next steps</strong>. Sketch, evaluate, note issues, and try addressing them in a future iteration. Any change can bring new problems, and the sooner I capture them, the better. It’s just so easy to spot and forget. I’ll take side notes more systematically in the future.</p>
<h3 id="heading-prototyping">Prototyping</h3>
<p>You can try the prototypes below if you use <a target="_blank" href="http://principleformac.com/index.html">Principle</a>, on a Mac or an iPhone directly. Click the movie captions to download the Principle .prd files. To learn more check <a target="_blank" href="http://principleformac.com/docs.html#running-on-device">Principle’s docs</a>, and my tips at the end of the post.</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/Iw0SnOEAmZH3CKrbMefFowTxKp9bYkcgUi8q" alt="Image" width="800" height="600" loading="lazy">
_[Download v8](https://www.dropbox.com/s/i8lsat5mq5w9x8i/homeless%20v8.prd?dl=1" rel="noopener" target="<em>blank" title=")</em></p>
<p>An early version (v8 above) features the chevron at the top and a discreet Home button at the bottom. Tapping the chevron re-opens the current app (what else could it do?) but so does a tap on the app miniature already.</p>
<p>So this chevron based interaction looks silly, in hindsight. Pay attention to the animation it triggers: While it does the right thing (zooming in the app correctly represents the action of bringing it to the foreground), it is disconnected from the chevron object itself. The chevron, on one hand, is doing what you want (dismiss switcher and return to app) but on the other hand it does <em>not</em> behave as you’d expect (slide down). Prototyping instantly trapped the contradiction here. I should have caught the flaw much earlier, but that’s ok — there are many things in my life that I should’ve done earlier.</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/LH5LZRNSFe0foAcKRCUVBBjXcRzwIg8yo-r4" alt="Image" width="800" height="600" loading="lazy">
_[Download v11](https://www.dropbox.com/s/6dsveqoqusqam8g/homeless%20v11.prd?dl=1" rel="noopener" target="<em>blank" title=")</em></p>
<p>The chevron is gone (v11 above) but I now experiment with a home screen miniature (like in iOS 10's switcher). This is efficient for the home screen use case, but it pushes the previous app (green) too far left for a right-hander. And there’s duplication again: the Home button becomes redundant, but if I remove it then the user can only rely on the miniature to go to home screen, which is too far right for <em>left-handers</em>! They could scroll but in this particular case I certainly don’t want them to have to.</p>
<p>There’s another aspect: this model is inconsistent with my target one, whereby only a tap on the background should take you home. This is key for the coherence of the whole, and central to the beauty of the new iOS 11 switcher. Why? Because <strong>the blurred background behind the switcher <em>is</em> the home screen.</strong> Any specific affordance to access the home screen (such as a Home button or my miniature) is superfluous (not to say incoherent) when you can interact with the home screen <em>directly</em>. Depth is one of the core design principles in iOS — with Clarity and Deference — and Apple beautifully builds on it here.</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/fKt156S1jrG3GdSdduTaIh-g9ECryaj-W0zy" alt="Image" width="288" height="456" loading="lazy">
<em>Main mental model layers in iOS 11</em></p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/XGPDJ5m0tQYmMDZS9qFFbE9GP3h3q-j1pcJE" alt="Image" width="800" height="600" loading="lazy">
_[Download v14](https://www.dropbox.com/s/9p5zon3u8kfkjru/homeless%20v14.prd?dl=1" rel="noopener" target="<em>blank" title=")</em></p>
<p>In the final v14 iteration above I clean up and more strictly align with the iPad switcher. That’s the version I present in <a target="_blank" href="https://medium.freecodecamp.org/homeless-iphone-20c154fabbf7">part 1</a>. A further improvement could be to enlarge the empty area at the bottom, for instance by limiting the Control Centre grid to 3 rows.</p>
<p>One last quote from Matthew Frederick’s excellent <a target="_blank" href="https://mitpress.mit.edu/books/101-things-i-learned-architecture-school">101 Things I Learned in Architecture School</a>:</p>
<blockquote>
<p>Properly gaining control of the design process tends to feel like one is <em>losing</em> control of the design process […] Accept uncertainty. Recognize as normal the feeling of lostness that attends to much of the process.</p>
</blockquote>
<p>On my journey I drifted away from my initial goal several times and accidentally glimpsed at different possibilities. Some may be worth revisiting later, some opened my eyes to new pitfalls. The wandering isn’t waste, it is the essence of exploration. At the same time one can’t keep opening boxes and adding todos forever; it’s also important to deliver reasonably stable and presentable solutions as you go along. The challenge is to strike a balance between breadth and depth.</p>
<h4 id="heading-tips-if-you-try-the-prototypes"><strong>Tips – if you try the prototypes</strong></h4>
<ul>
<li>Interactions are limited to: swipe up, scroll horizontally, tap the blue app miniature, tap the switcher’s background. In the home screen, tap the blue icon only.</li>
<li>The intermediate Dock state that I describe in the previous post is not supported by the prototypes I share here. In order to create the Dock state movie I made a temporary modification.</li>
<li>The prototypes are designed for the ‘iPhone 8’ itself, at 375 * 812 points (145 pt taller than an iPhone 6/7). So if your test device, like mine, is a 6/7 series, Principle scales down the UI a bit so that it fits your display: Everything looks a bit smaller than it should be. And positioned a bit higher too, due to the bottom area on the 6/7 (no such chin on the future edge to edge display).</li>
<li>However, if you <a target="_blank" href="https://www.dropbox.com/s/2cykf04u1vzpzc3/Simulated%20iPhone%208%20rendering%20%28view%20on%20a%204.7%20inch%29.png?dl=1">open this image on a 6/</a>7 you get a much better idea of the expected ‘iPhone 8’ feel. Just imagine the phone is taller and that you can tap the bottom area anywhere. You may need to first save the image to your photo library. It’s supposed to fill the entire screen and look like this:</li>
</ul>
<p><img src="https://cdn-media-1.freecodecamp.org/images/iCC1SBV7SoerqKjrzZ7IF1BhaewkpYhW2636" alt="Image" width="395" height="335" loading="lazy"></p>
 ]]>
                </content:encoded>
            </item>
        
    </channel>
</rss>
