<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Hesham Salman on Medium]]></title>
        <description><![CDATA[Stories by Hesham Salman on Medium]]></description>
        <link>https://medium.com/@hesham.salman?source=rss-6f7f89dffe94------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*uUIfIDkJlqw6ye97.jpeg</url>
            <title>Stories by Hesham Salman on Medium</title>
            <link>https://medium.com/@hesham.salman?source=rss-6f7f89dffe94------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 20 Nov 2026 00:08:48 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@hesham.salman/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[The iOS Testing Manifesto]]></title>
            <link>https://medium.com/@hesham.salman/the-ios-testing-manifesto-e1bc821cc4c3?source=rss-6f7f89dffe94------2</link>
            <guid isPermaLink="false">https://medium.com/p/e1bc821cc4c3</guid>
            <category><![CDATA[testing]]></category>
            <category><![CDATA[ios-app-development]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[swift]]></category>
            <category><![CDATA[xcode]]></category>
            <dc:creator><![CDATA[Hesham Salman]]></dc:creator>
            <pubDate>Mon, 14 May 2018 13:07:05 GMT</pubDate>
            <atom:updated>2019-06-10T15:52:44.782Z</atom:updated>
            <content:encoded><![CDATA[<h4>Table of Contents</h4><ul><li><a href="https://medium.com/p/e1bc821cc4c3#e6a6">Rules For Writing A Good Unit Test</a></li><li><a href="https://medium.com/p/e1bc821cc4c3#e1f1">Test Driven Development</a></li><li><a href="https://medium.com/p/e1bc821cc4c3#da1d">Dependency Injection</a></li><li><a href="https://medium.com/p/e1bc821cc4c3#31a8">Mocks, Stubs, Fakes, Spies, Dummies</a></li><li><a href="https://medium.com/p/e1bc821cc4c3#ed35">Model Testing</a></li><li><a href="https://medium.com/p/e1bc821cc4c3#f6d5">View Testing</a></li><li><a href="https://medium.com/p/e1bc821cc4c3#0a6e">Controller Testing</a></li><li><a href="https://medium.com/p/e1bc821cc4c3#f22e">Testing Other Objects</a></li><li><a href="https://medium.com/p/e1bc821cc4c3#22c6">Other Frameworks</a></li><li><a href="https://medium.com/p/e1bc821cc4c3#2a60">Resources</a></li></ul><p>Most engineers agree that testing is good. There have been so many articles and blogs about the benefits of testing that they’re too numerous to list. But what does it mean to write a unit test in the iOS environment? What makes a good unit test? What’s worth testing?</p><p>iOS developers are notoriously <em>bad</em> at writing unit tests — in the sense that as a community, we don’t seem to write too many of them. In 2013, I was vaguely aware of SenTestingKit — and like most other iOS developers, didn’t use it. I had a number of rationalizations about why I didn’t write tests — from things like “I have types, and so I’m not as concerned about things going wrong like in Python or Ruby” to “Why should I waste time verifying my code works when I <em>already know</em> that my code works?”</p><p>A few years later, I had realized that there’s no good replacement for unit tests. Testing isn’t a <em>nice-to-have</em>, it’s an absolute <em>game-changer. </em>Working in a well tested codebase gives me the confidence to make changes and experiment without fearing that I’ll break something <em>somewhere</em> in the application. I know that if something goes wrong with my refactor, or with the integration of my new feature, I’ll likely have a wall of test failures notifying me of my mistake. Most importantly, it can make new-comers to a codebase understand the intent behind each function.</p><h3>Rules For Writing A Good Unit Test</h3><ol><li>Each individual test should be <em>fast</em>.</li><li><strong>No networking</strong> in unit tests. If a unit test performs a networking event, it’s not a unit test!</li><li>Tests should be independent and isolated. Tests should not mutate state for other tests, and they shouldn’t perform tear-down or set-up for one another.</li><li>Tests should be repeatable. A flaky test causes more harm than it’s worth. Either fix them or delete them.</li><li>No dependencies out of your control. Don’t have tests rely on a fixed system date, timezone, or otherwise — these things should either be in the testing suite or the testing environment. Stubbed data shouldn’t be reliant on near-future dates.</li></ol><p>In addition, a good test has the following shape:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/5a71ea022bcc74a28b2d1938251f70b1/href">https://medium.com/media/5a71ea022bcc74a28b2d1938251f70b1/href</a></iframe><p>Let’s take a look at what’s going on up there:</p><ol><li><strong>Naming</strong>. Every XCTest function starts with test. The underscores delimit logical groupings. The second logical group is the behavior being tested, and the third logical grouping is the context under which it’s being tested. A fourth logical grouping can be added if the context merits it.</li><li><strong>Setup.</strong> Explicitly listing the dependencies needed to put an object under test in the desired state.</li><li><strong>Behavior Modification</strong>. Calling the method, or setting the value that causes the change in the object under test.</li><li><strong>Capturing Changes</strong>. When comparing two values, explicitly capture both the expected and actual values. When setting the expected value, use fixed data if possible.</li><li><strong>Assertion</strong>. This is where our assumptions about the behavior of the class are tested against the actual behavior of the class.</li></ol><p>When tests have a fixed format and shape, it makes it easy for future developers to assess the goal of the test and usage of the class/function. Tests will often serve as a form of documentation for functions and objects to future developers.</p><h3>Test Driven Development</h3><p>Getting into the habit of writing tests before — or alongside — production code can feel strange at first. Many iOS developers say that TDD isn’t part of their workflow for one reason or another. In Swift and Objective-C, we have to be mindful of our compiler and type conformances. We can’t practice TDD in quite the same way that someone working in <a href="http://rspec.info/">Ruby</a> or <a href="https://facebook.github.io/jest/">JavaScript</a> can, but we can — and should — still do it.</p><p>When writing unit tests for our functions and classes, it helps to borrow a concept from our functional-programming friends and think of functions in terms of their signatures. For example, if we need a function to generate the text for a label from some TrafficLight model, our signature is (TrafficLight) -&gt; String. We always begin by writing the most simple, empty-form of our function, writing failing tests, and then iterating until the tests pass.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c3246dc119616c1f950fecc6c641ff77/href">https://medium.com/media/c3246dc119616c1f950fecc6c641ff77/href</a></iframe><p>Let’s observe what’s happening above:</p><ol><li>We wrote our function in terms of its signature, returning a base case that we fully expect to fail.</li><li>We wrote all of our expected test cases for this function.</li></ol><p>Once we have our failing tests, it’s important to actually run them and watch them fail; it’s impossible to make tests go from failing to passing if they already pass. Once they fail, begin iterating in the production class until all of our test cases are successful.</p><h4>Writing Tests for Existing Classes With No Tests</h4><p>As engineers, the majority of our jobs isn’t to write new code — it’s to maintain and modify existing code. Quite often, legacy code doesn’t have unit tests which can make working in it a dangerous task that’s prone to regression. The first step to working in a legacy file, or a file with no unit tests, is to write tests targeting the existing functionality that will be changed. This means understanding the subset of functionality of that file that will be affected, and writing tests that document its current behavior.</p><p>When writing tests for existing classes with no coverage, it’s important to still double-check that tests are valid by modifying them so that they fail when we expect them to. If we only write green tests, we are unlikely to have a good understanding of the original design and intent of the class. We may have to modify some of the implementation of the original class in order to make it easily testable — it may not have been written with dependency injection in mind, or may have a large list of implicit dependencies. When modifying the original class for testability, we should try to minimize the number of changes so that we disturb the original code as little as possible.</p><p>Once existing behaviors are documented, now we can begin the standard TDD flow.</p><p>If an application is entirely — or mostly — untested, a great approach is to gradually add in tests to classes as they are modified, for the parts that have been modified.</p><h3>Dependency Injection</h3><p>Martin Fowler has <a href="https://martinfowler.com/articles/injection.html">written extensively about dependency injection</a>.</p><p>In general, when designing our classes, try to set it so that the properties held within a class are passed in through the constructor. If our constructor grows large, allow setters on the object.</p><p>As a rule of thumb, have constructor-injection for private variables (preferably with defaults in the constructor), and setter-injection for public variables.</p><p>Do not sacrifice access-control for testability. When testing private members, hold a reference, inject them, and test their internal state accordingly.</p><h3>Mocks, Stubs, Fakes, Spies, Dummies</h3><p>It’s important to isolate our tests to our local environment. If objects have references to other things — network services, delegates, etc… — it’s important to inject a simplified or controllable version of that object. Test objects that have different purposes have unique names. The terminology itself isn’t as important as the idea, but a quick set of rules for identifying these objects are:</p><ul><li><strong>Mocks</strong> are objects that register the calls they receive.</li><li><strong>Stubs</strong> are objects that hold pre-defined data and use it to answer calls during tests. They’re often used to test networking.</li><li><strong>Fakes</strong> are objects that have working implementations, but not the same as production.</li><li><strong>Spies</strong> are stubs that record some information based on how they were called. This can mean counting the number of times a function was called, holding references to the parameters passed in, or something else .</li><li><strong>Dummies</strong> are objects passed around but never actually used — often just for filling parameter lists.</li></ul><p>Personally, I usually avoid fakes because it can easily lead down a path of testing test-code instead of testing production code.</p><h3>Model Testing</h3><p>Models are usually the first place I start when writing code. They’re easier to test than most — they’re relatively isolated and self-contained. It’s easy to get away without writing tests for a model like this:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d2159c1bf3cb7bd80d833b48817e8cd1/href">https://medium.com/media/d2159c1bf3cb7bd80d833b48817e8cd1/href</a></iframe><p>But once a mutating function, public function, didSet, or calculated property is written on a model, we need to add tests for those functions. In addition, we should always create a testing model factory for each of our new models (enums being the exception), even if they don’t have tests associated with them.</p><h4>Model Factories</h4><p>A model factory is exactly what it sounds like — a convenience constructor that gives the ability to create a new instance of a model with <strong>zero arguments</strong>. These are objects that exist only in the test suite.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a4944c00083030b825d558fe5ba0b40e/href">https://medium.com/media/a4944c00083030b825d558fe5ba0b40e/href</a></iframe><ol><li>Factories should be an enum so that nobody can accidentally instantiate this object.</li><li>The create function should take all of the arguments of the model’s init, and supplies a default value for all values (where possible). This has the dual benefit of giving us a zero-argument init as well as a constructor that can conceivably accept any injectable or observable property on the model.</li></ol><p>Model factories form the basis of dependency injection.</p><h4>Enums</h4><p>Enums do not require a factory. Otherwise all other rules apply.</p><h3>View Testing</h3><p>There are a number of different philosophies to testing views. Most people fall into three camps:</p><ol><li>Use XCUITest to test views, automating a portion of a smoke-test.</li><li>Use iOS-snapshot-test-case to test views.</li><li>Write unit tests and forget about UI tests.</li></ol><h4>XCUITest</h4><p>XCUITest is built into Xcode and is Apple’s UI testing framework. It comes with a few handy features, like a UI Test Recorder to generate tests.</p><p>Unfortunately, XCUITest fails two of the basic rules of testing:</p><ol><li>UI tests written with XCUITest are slow. Testing a log-in flow can take up to ten minutes.</li><li>UI tests written with XCUITest are flaky. They have a lopsided signal-to-noise ratio.</li></ol><p>For those reasons, XCUITest is unsuitable for production use with automated integration environments.</p><h4>iOS-Snapshot-Test-Case</h4><p>Snapshot testing uses stubbed data to assert the correctness of some code. In this instance, snapshot testing records screenshots of iOS views and makes sure they don’t unexpectedly change. Snapshot test failures produce diffs for inspection.</p><p><a href="https://github.com/uber/ios-snapshot-test-case">iOS-Snapshot-Test-Case</a>, formerly FBSnapshotTestCase, is maintained by Uber and used in a large number of production applications. Unlike XCUITest, it’s fast and far more reliable.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/26bc524954efa0b0cd60c13fa596ee2d/href">https://medium.com/media/26bc524954efa0b0cd60c13fa596ee2d/href</a></iframe><ol><li>We inherit from FBSnapshotTestCase instead of XCTestCase.</li><li>We set the recording mode. On first run, set this to true, which creates a reference image on disk to test against.</li><li>We test our current view against our reference image.</li></ol><p>For a more detailed jump into snapshot testing, check out <a href="https://www.stephencelis.com/2017/09/snapshot-testing-in-swift">this article by Stephen Celis</a>.</p><h4>No UI Tests</h4><p>There’s an argument to be made about the cost-value ratio of this type of testing. This type of testing is most easily caught during a QA-run or smoke-test. Assuming high unit test coverage, this type of testing may not provide much value — although I’m personally of the belief that it can prevent unexpected UI regressions, and is especially useful when upgrading SDK versions.</p><h3>Controller Testing</h3><p>It’s important to test all of the responsibility of a controller. For the purposes of this article, I’m assuming that controllers have the following responsibilities:</p><ol><li>Navigation</li><li>View presentation</li><li>Delegate conformance</li><li>Networking</li></ol><p>If some of these responsibilities, such as networking or navigation, have been delegated to another object (such as a ViewModel, Interactor or Entity), these guidelines still apply to those objects.</p><h4>Testing Navigation and View Presentation</h4><p>When testing navigation, a UIWindow is required in the testing class.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e1896d03096bc689727f0f0bedea5e01/href">https://medium.com/media/e1896d03096bc689727f0f0bedea5e01/href</a></iframe><p>Let’s explore:</p><ol><li>We are declaring our variables and keeping a reference to them.</li><li>We are instantiating a UINavigationController in order to test push actions.</li><li>We are instantiating a UIWindow so that we can properly present controllers whose views are in the view hierarchy.</li></ol><p>At this point, we can safely test navigation:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b81ff061bd8d1bc36541317ef36ebef1/href">https://medium.com/media/b81ff061bd8d1bc36541317ef36ebef1/href</a></iframe><p>When testing navigation as a result of interaction with a UITableViewController or UICollectionViewController, it’s generally a good idea to inject the data into the controller in your tests or use an enumeration that dictates which rows/sections everything belongs to. Typing out a raw index path can lead to brittle tests.</p><h4>Delegate Conformance</h4><p>In the case of delegate conformance, we only want to test that calling the delegate methods performs the action that we expect.</p><p>Testing this should be no different than testing any other function. We do not have to test that these methods get called when the object that holds a reference to the delegate does something.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3fbe909fceb6f12f9d282f322224752f/href">https://medium.com/media/3fbe909fceb6f12f9d282f322224752f/href</a></iframe><ol><li>We are declaring our dependencies.</li><li>We are calling the function or setting the values that we believe will cause our controller to behave a certain way.</li><li>We are retrieving a value that we can test against.</li><li>We are testing our assumptions with a type-check.</li></ol><p>Notice that we are not writing redundant tests, such as:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/765d85dc9931fe6de3d5d225f6ceb5eb/href">https://medium.com/media/765d85dc9931fe6de3d5d225f6ceb5eb/href</a></iframe><p>These types of test don’t provide much value because they don’t test the behaviors that we expect — they only test type/protocol conformance.</p><h4>Testing Networking</h4><p>When testing networking, it’s important to remember that we are not going to actually make a network call. When testing networking, it is standard to work against a stubbed response.</p><p>Let’s take a look at testing the successful case of an asynchronous network call:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f470fccd688169c2ceba8f423970324b/href">https://medium.com/media/f470fccd688169c2ceba8f423970324b/href</a></iframe><ol><li>We are declaring our dependencies, mock, and stubs.</li><li>We are declaring further dependencies and composing with dependency injection.</li><li>We are setting an expectation for testing asynchronous calls.</li><li>We enter the context of our asynchronous network call.</li><li>We bail early if something was wrong with our set-up.</li><li>We begin testing our assumptions.</li><li>We fulfill our expectation</li><li>We set our time-out for our asynchronous test.</li></ol><p>It’s important to test the successful and unsuccessful variants of a network call. If we are displaying an alert or toast on networking failure, make sure to test for that.</p><h3>Testing Other Objects</h3><h4>Delegates</h4><p>Test delegates in the classes that hold onto them. For example, if we have a class like this:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ad29ac4a1c120f87110a090ceffedfb7/href">https://medium.com/media/ad29ac4a1c120f87110a090ceffedfb7/href</a></iframe><p>In our test class, we should make sure that the delegate method is being called when we expect.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2093e75d8f24cf6f37da6c799f3c11f4/href">https://medium.com/media/2093e75d8f24cf6f37da6c799f3c11f4/href</a></iframe><ol><li>A mock delegate is declared as a top level class in the test target (it could be useful in other classes).</li><li>The mocked method just updates the mock object’s state for introspection.</li><li>We trigger an event that we believe will give us something to test our assumptions against.</li><li>We test our assumptions.</li></ol><h4>View Models</h4><p>Testing view models / view configurations is very similar to testing other models. Let’s take a look at a simple view model:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/29d60409cd2520e2d12d4c53e723adb6/href">https://medium.com/media/29d60409cd2520e2d12d4c53e723adb6/href</a></iframe><p>Testing this involves checking that the text, images, colors, and any other use-facing outputs of the view model are as we expect them. Of course, these tests should be written <em>before</em> the view model, because otherwise we are just copy-pasting production code into our tests. Green-only tests don’t tell us anything.</p><h3>Other Frameworks</h3><h4>Quick and Nimble</h4><p><a href="https://github.com/Quick/Quick">Quick</a> and <a href="https://github.com/Quick/Nimble">Nimble</a> are BDD frameworks, deeply inspired by Ruby’s RSpec. Personally, I believe that Quick provies a far superior testing framework to XCTest. Ruby’s Rspec is to many people — myself included — the gold standard to which all other testing frameworks are held against. Quick and Nimble replicates the behavior and usage of Rspec while keeping the syntax Swift-y.</p><p>For a more detailed look at BDD best practices, check out the <a href="http://www.betterspecs.org/">BetterSpecs</a> website.</p><h4>SwiftCheck</h4><p><a href="https://github.com/typelift/SwiftCheck">SwiftCheck</a> is a generative testing framework, intended to be a port of Haskell’s QuickCheck. Haskell’s QuickCheck (and thus SwiftCheck) relies on the notion that pseudo-random chaos is the best test against a function. Instead of writing out specific test-cases, we write a function that details the valid outputs of a given function. SwiftCheck generates an arbitrary set of data to test each function, and runs that arbitrary set through — testing that each output is valid.</p><h4>SwiftMonkey</h4><p><a href="https://github.com/zalando/SwiftMonkey">SwiftMonkey</a> is similar to SwiftCheck, but is intended to generate chaotic, random UI tests. SwiftMonkey suffers from the same problems as XCUITest, but is useful for discovering rare crashes in an application.</p><h3>Resources</h3><ul><li><a href="https://www.sandimetz.com/99bottles">99 Bottles of OOP</a> by Sandi Metz. This is a book written for Ruby developers, but every idea shared there applies generally to programming. Most notably, red-green refactoring, shameless green commits, and flocking rules.</li><li><a href="https://www.amazon.com/Working-Effectively-Legacy-Michael-Feathers/dp/0131177052">Working Effectively With Legacy Code</a> by Michael Feathers. Great book about how to deal with legacy projects that don’t have any tests.</li><li><a href="https://github.com/orta/pragmatic-testing">Pragmatic Testing</a>, by Orta Therox (and others). Open Source eBook on iOS testing.</li><li><a href="https://academy.realm.io/posts/tryswift-ash-furrow-artsy-testing-tour/">An Artsy Testing Tour</a>, a try!Swift talk by Ash Furrow.</li><li><a href="https://academy.realm.io/posts/try-swift-brandon-williams-writing-testable-code/">The Two Sides of Writing Testable Code</a>, a talk by Brandon Williams.</li><li><a href="https://academy.realm.io/posts/cmdu-michael-may-testing-untested-app/">Testing an Untested App</a>, a talk by Michael May.</li></ul><p>Follow me on <a href="https://medium.com/@hesham.salman">Medium</a> or <a href="http://twitter.com/_IronHam">Twitter</a> for more content.</p><figure><a href="https://usejournal.com/?utm_source=medium.com&amp;utm_medium=noteworthy_blog&amp;utm_campaign=guest_post_image"><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*f2IVAl0TbsfES9cFGYr40g.png" /></a></figure><p>📝 Read this story later in <a href="https://usejournal.com/?utm_source=medium.com&amp;utm_medium=noteworthy_blog&amp;utm_campaign=guest_post_read_later_text">Journal</a>.</p><p>🗞 Wake up every Sunday morning to the week’s most noteworthy Tech stories, opinions, and news waiting in your inbox: <a href="https://usejournal.com/newsletter/?utm_source=medium.com&amp;utm_medium=noteworthy_blog&amp;utm_campaign=guest_post_text">Get the noteworthy newsletter &gt;</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e1bc821cc4c3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[An iOS Developer’s Journey Into React Native]]></title>
            <link>https://medium.com/react-and-respond/an-ios-developers-journey-into-react-native-8dbb18cca6d0?source=rss-6f7f89dffe94------2</link>
            <guid isPermaLink="false">https://medium.com/p/8dbb18cca6d0</guid>
            <category><![CDATA[react-native]]></category>
            <category><![CDATA[ios-app-development]]></category>
            <category><![CDATA[swift]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[ios]]></category>
            <dc:creator><![CDATA[Hesham Salman]]></dc:creator>
            <pubDate>Wed, 02 May 2018 15:42:07 GMT</pubDate>
            <atom:updated>2018-05-02T15:42:07.946Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cVDMxgji4YN1GlDY1TWzew.png" /></figure><p>Like many iOS developers, I had sour opinions on JavaScript. I remembered JavaScript as that <em>weird, wild-west</em> language where no two environments are the same. My memories of JavaScript were formed at a time when Xcode’s native tooling was <em>far</em> superior to web tooling — we had cool stuff like storyboards, auto-completion, great feedback built into our development environment, and ubiquitous integrated libraries.</p><h4>Tooling</h4><p>In the years since then, the web has made improvements and achievements at break-neck speed while Xcode is… largely the same (with the addition of Playgrounds in Swift) or worse (Swift refactor tools) . The JavaScript language and development environments have evolved. All of the features of Xcode that we loved — IDE auto-completion, in-line docs, immediate feedback for syntax errors — are basically built into modern environments. Storybooks — which are basically the equivalent of Xcode Playgrounds — are fantastic (and through a <a href="https://marketplace.visualstudio.com/items?itemName=Orta.vscode-react-native-storybooks">great extension by Orta</a>, built into VSCode).</p><h4>Testing</h4><p>JavaScript testing (through <a href="https://facebook.github.io/jest/">Jest🃏</a>) is in another league. It’s near-instant, it’s automatic (it watches Git changes and runs tests for affected files), it has an <a href="http://www.betterspecs.org/">RSpec-like syntax</a>, and it runs on every save. Native unit testing has always felt like an afterthought — to the point that there are <a href="https://ashfurrow.com/blog/apple-releases-jive/">blog posts</a> about a hypothetical modern testing framework released by Apple.</p><p>XCTest is great, but it feels like a legacy testing framework. It’s hardly different from JUnit, limited to one setUp method and one tearDown method, and has no ability to automatically run tests on save. Alternatives like <a href="https://github.com/Quick/Quick">Quick</a>/<a href="https://github.com/Quick/Nimble">Nimble</a> are great and modern, but basic features (like running an individual test) will remain missing without first-party support built into Xcode.</p><h4>Feedback Loop</h4><p>JavaScript’s feedback loop is much faster than native. I’ve never worked on a large native project that didn’t have absurd feedback cycles. In some projects, it can take a full <em>thirty minutes</em> to go from git clone to a copy change. Incremental builds could be anywhere between 20 seconds to 3 minutes — just long enough to lose focus or get distracted by Twitter. The simulator restarting, and having to manually navigate back to your controller is painful.</p><p>Enter: Hot Reloading.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1014/1*v24tUgM_6YaK5PGtlxJtxw.gif" /></figure><p>An optimal feedback loop makes a huge impact on developer productivity and code-quality. The approach to writing code is <em>so different</em> when the feedback loop is long — I found myself trying to create an entire feature or entire screen at once, hitting compile, and hoping for the best while I grabbed coffee or went for a walk. True TDD is impossible to practice when compile times are measured in minutes. At the shorter feedback loops that JavaScript allows for, I found myself practicing red-green refactoring, real TDD, and having real-time design iteration.</p><h4>Performance and “Feel” of React Native</h4><p>Even when I began to hear about the improvements in the non-native development environment, I scoffed. I remember how awful PhoneGap applications felt and how difficult working with Xamarin was (it may have improved over the years?). I remember how the mobile applications produced with those technologies didn’t <em>feel right </em>and<em> </em>how they were slow to scroll or transition.</p><p>But, even though React Native definitely has some <a href="https://codeburst.io/react-native-vs-real-native-apps-ad890986f1f">increased overhead</a>, its performance is fast enough to the point where I’d be hard-pressed to know which apps I use are native or react-native. And when it comes to doing something that requires performant code, you can write that code natively in your React Native application — meaning, that you can live with a better development environment, faster cycles, hot reloading, and better tests in 99% of cases. For the remaining 1% of cases, it’s easy to fallback to the native environment that you’re likely already comfortable with.</p><h4>Future</h4><p>The future of React Native isn’t as certain as the future of Swift. There’s little fear of Apple dropping Swift tomorrow, next week, or next year — but who knows if React Native will still be an active project in five years? These fears are fair, but realistically it doesn’t make sense to think about the technology of five years from now. Pull up your phone. Page through your apps. How many of those apps have existed for more than five years, and of those that have, how many of them haven’t gone through a complete re-write or re-architecture recently?</p><p>Years ago, when I chose to become an iOS developer it was because I was building for device that felt intimate and personal, but it was primarily because the developer experience was fantastic. The community support was great, and the ubiquity of the tools and frameworks made it so that iOS developers were all using a shared set of tools. Xcode and its tooling had advantages over web development environments.</p><p>Today, the better experience lies with React Native — when it comes to testing, development, tooling, and arguably even IDE-performance.</p><p>Over the next few months I’ll be documenting my journey into the world of React Native from the lens of an iOS developer, where I’ll uncover and share all of the great, not-so-great, and just-okay things about React Native development.</p><h4>Further Reading</h4><ul><li><a href="https://artsy.github.io/blog/2017/07/06/React-Native-for-iOS-devs/">Intro to React Native for an iOS Developer — Artsy Engineering</a></li><li><a href="http://makeitopen.com/">makeitopen.com · Building the F8 App</a></li><li><a href="https://ashfurrow.com/blog/swift-vs-react-native-feels/">Swift vs. React Native Feels — Ash Furrow</a></li></ul><p>Follow me on Twitter for more content <a href="https://twitter.com/_hsalman">hesham salman (@_hsalman) | Twitter</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8dbb18cca6d0" width="1" height="1" alt=""><hr><p><a href="https://medium.com/react-and-respond/an-ios-developers-journey-into-react-native-8dbb18cca6d0">An iOS Developer’s Journey Into React Native</a> was originally published in <a href="https://medium.com/react-and-respond">React and Respond</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Goodbye, Storyboards]]></title>
            <link>https://medium.com/@hesham.salman/goodbye-storyboards-c19ea06708a7?source=rss-6f7f89dffe94------2</link>
            <guid isPermaLink="false">https://medium.com/p/c19ea06708a7</guid>
            <category><![CDATA[swift]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[xcode]]></category>
            <category><![CDATA[ios-app-development]]></category>
            <category><![CDATA[apple]]></category>
            <dc:creator><![CDATA[Hesham Salman]]></dc:creator>
            <pubDate>Sun, 04 Feb 2018 08:33:55 GMT</pubDate>
            <atom:updated>2018-04-10T13:58:25.475Z</atom:updated>
            <content:encoded><![CDATA[<p>Like many other iOS developers, I began by making my interfaces in the storyboard. It seemed straightforward, and it was relatively easy to throw constraints at a wall and see what stuck. However, after several years — I’m putting storyboards behind me.</p><p>Storyboards are a great way to acquaint yourself with the UIKit components that Apple provides. Storyboards allow you to <em>visualize</em> what that table, button, or flim-flam view will look like on a screen. When I began working with iOS, I had a faint idea of what most components were, but I didn’t understand iOS’s view lifecycle or view-binding model — and moreover, I didn’t care to. At the time, I was obsessed with the concept of building a focus game that was the swiping equivalent of <em>Dance Dance Revolution</em>. I didn’t know anything about any of Apple’s APIs or their intended uses. At the time that I started building it, Swift had just released as a language. I figured it was my opportunity to learn a new language at the same time as everyone else, and because it was a new language I thought that I could hardly be <strong>wrong</strong> for writing odd code.</p><p>Storyboards were instrumental in helping me get my first project out of the door. I didn’t need to think about frames or plan my UI — I was able to design it on the fly in real time and throw constraints at it until it appeared the way I had expected. In other words, I was able to rapidly prototype a UI with little technical knowledge of how that UI worked.</p><p>A few years later, I’m working on a production app.</p><p>And storyboards became my nightmare.</p><h4>The Problem With Storyboards</h4><p>The primary draw of storyboards — rapid prototyping with little consideration of auxiliary features — is what hurts them the most. If your app is localized, any strings in your storyboard won’t be (1). Similarly, setting fonts and colors in the storyboard make those fonts and colors permanent members of your UI; they no longer change with your programmatic style guide.</p><p>In trying to mitigate these issues, you may end up in a worst-of-both-worlds situation: your view controllers are all in storyboards (and thus have @IBOutlets) that you have to manually configure, and you can no longer have custom init functions for your view controller.</p><p>Your code may look something like this:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/57470dd396897b426c40b3d22a4cf946/href">https://medium.com/media/57470dd396897b426c40b3d22a4cf946/href</a></iframe><p>There are many drawbacks to code written this way, such as:</p><ol><li>There’s no other option than the implicitly unwrapped optional for the dependency. If it’s truly a dependency, then it <em>has</em> to be there. Ideally this should be in an init function, but that won’t be possible with a storyboard. Anybody using this class must now <strong>magically know</strong> that it has a dependency, and that it’s could crash the application if that dependency isn’t passed.</li><li>Having to style your views entirely in code defeats the purpose of using storyboards.</li><li>Although the workaround is designed to be resilient to style changes, it cannot account for a style-guide change to layout margins.</li></ol><p>The first point — the lack of an init function and inclusion of an implicitly unwrapped dependency — becomes more problematic as the number of contributors to the application grow. Imagine that this application were OSS, and someone wanted to create a view that pushed an AirplaneViewController. That code may look something like this:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/001c81adab15e27d35d3553d3ee25451/href">https://medium.com/media/001c81adab15e27d35d3553d3ee25451/href</a></iframe><p>Frankly, it’s a lot of code to be reading (2) when all you’re really trying to do is this:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7ad94a7c47e436b69da33da749cfcb43/href">https://medium.com/media/7ad94a7c47e436b69da33da749cfcb43/href</a></iframe><p>The first example is:</p><ul><li>Long winded without justification</li><li>Error prone</li><li>Difficult to extend</li></ul><p>What if we had the id of an Airplane object, instead of the populated object? We’d either have to start making a mess of our initial view controller’s API, or we’d have to trigger a network call to fetch the Airplane object before being able to push it. Its programmatic alternative could have a failable initializer that takes an object id.</p><p>All in all, storyboards can make code messy, inflexible, and error-prone.</p><h4>Programmatic Views</h4><p>Initially, the concept of programmatic views gave me flashbacks to Java’s AWT and SWING libraries: verbose, big, hard to understand (as the reader). Nobody wants to open up a view and be greeted with the equivalent of <em>somebody else’s Perl script</em>. There are many solutions to this problem, including: SnapKit (❤️), Apple’s Visual Format Language (🤢), or programmatically instantiating and adding every constraint (🤮).</p><h4>Nibs</h4><p>I feel largely the same way about nibs as I do about storyboards. They share many of the same drawbacks, but aren’t quite as harmful to an application because they are purely concerned with the View; storyboards are concerned with both the View and the Controller.</p><p>Storyboards served me well as I was learning iOS, and <strong>I would still recommend that people learning iOS Development use them exclusively for some time</strong>. But at some point they’ll become more trouble than they’re worth — and when that time comes, let go.</p><h4>Footnotes:</h4><ol><li>Xcode 9 actually introduced localizable strings in the storyboard.</li><li>As always, there’s a work-around — a function named after the class that takes the supplied argument:</li></ol><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3af7c79ff3242cdb06558dec58c4ea62/href">https://medium.com/media/3af7c79ff3242cdb06558dec58c4ea62/href</a></iframe><p>The problem with this is that it leaves multiple init functions around, it’s still long-winded, these functions aren’t necessarily part of the class/file, and frankly a new-comer to your codebase can still instantiate this class incorrectly.</p><p>For more content, follow me on Medium or on Twitter @_hsalman</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c19ea06708a7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What’s New in Swift 4]]></title>
            <link>https://medium.com/building-vts/whats-new-in-swift-4-21b77b02040c?source=rss-6f7f89dffe94------2</link>
            <guid isPermaLink="false">https://medium.com/p/21b77b02040c</guid>
            <category><![CDATA[swift]]></category>
            <category><![CDATA[xcode]]></category>
            <category><![CDATA[ios-app-development]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[ios]]></category>
            <dc:creator><![CDATA[Hesham Salman]]></dc:creator>
            <pubDate>Tue, 13 Jun 2017 13:06:32 GMT</pubDate>
            <atom:updated>2017-06-13T13:06:32.591Z</atom:updated>
            <content:encoded><![CDATA[<p>It’s that time of the year again! Luckily, this is a much less intense change than last year’s jump to Swift 3.</p><p>Unlike last year’s jump, this is a <em>much</em> smaller change — instead of taking a few weeks to implement the required syntactical changes, this jump will take a few hours. The Swift team was very mindful of breaking changes this year, and in many cases went out of their way to prevent a breaking change. As a result, most changes are additive, and many (as far as I’m concerned) are unlikely to be noticed (such as <a href="https://github.com/apple/swift-evolution/blob/master/proposals/0104-improved-integers.md">protocol-oriented-integers</a>).</p><h4>Changes</h4><h4><a href="https://github.com/apple/swift-evolution/blob/master/proposals/0110-distingish-single-tuple-arg.md">Distinguishing Tuple and Multi-Argument Functions</a></h4><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/417a9a631e67009722fb7fc21d72b572/href">https://medium.com/media/417a9a631e67009722fb7fc21d72b572/href</a></iframe><h4><a href="https://github.com/apple/swift-evolution/blob/master/proposals/0068-universal-self.md">Universal Self</a></h4><p>.Self is now supported in value types, and the dynamicType keyword was renamed to Self.</p><h4><a href="https://github.com/apple/swift-evolution/blob/master/proposals/0169-improve-interaction-between-private-declarations-and-extensions.md">Improved Interaction Between </a><a href="https://github.com/apple/swift-evolution/blob/master/proposals/0169-improve-interaction-between-private-declarations-and-extensions.md">private Declarations and Extensions</a></h4><p>private access control is extended so that members defined in an extension of a type have the same access as members defined on the type itself, so long as the type and extension are in the same source file.</p><p>This means that the difference between fileprivate and private is smaller than it’s ever been — but to summarize the difference:</p><ul><li>fileprivate access restricts the use of an entity to its own defining source file — you can use this to have a file-scope Section enumeration in every UITableViewController implementation.</li><li>private restricts the use of an entity to the enclosing declaration and its extensions.</li></ul><h4><a href="https://github.com/apple/swift-evolution/blob/master/proposals/0168-multi-line-string-literals.md">Multi-Line String Literals</a></h4><p>Long strings can now be delimited by triple quotes &quot;&quot;&quot;. The string in between the quotes retains style and can include individual &quot;.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/654979d1ece78432d9f76542017f453a/href">https://medium.com/media/654979d1ece78432d9f76542017f453a/href</a></iframe><h4><a href="https://github.com/apple/swift-evolution/blob/master/proposals/0167-swift-encoders.md">Swift Encoders</a></h4><p>New classes:</p><ul><li>JSONEncoder</li><li>JSONDecoder</li></ul><p>These work with classes/structs that implement the Codable protocol, and come with their own set of Foundation-provided errors.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/291e3c7845ca9de4d242bda83ac27d02/href">https://medium.com/media/291e3c7845ca9de4d242bda83ac27d02/href</a></iframe><h4><a href="https://github.com/apple/swift-evolution/blob/master/proposals/0166-swift-archival-serialization.md">Swift Archival &amp; Serialization</a></h4><p>New Protocols:</p><ul><li>Encodable</li><li>Decodable</li></ul><h4><a href="https://github.com/apple/swift-evolution/blob/master/proposals/0161-key-paths.md">Better Key-Value Coding</a></h4><p>You can use the new backslash operator to reference a key path of an object.</p><p>You can use key paths as in Obj-C, but they are strongly typed.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/0d518a2169c5474ea05d7e2c3feea38b/href">https://medium.com/media/0d518a2169c5474ea05d7e2c3feea38b/href</a></iframe><h4><a href="https://github.com/apple/swift-evolution/blob/master/proposals/0160-objc-inference.md">Limiting </a><a href="https://github.com/apple/swift-evolution/blob/master/proposals/0160-objc-inference.md">@objc inference</a></h4><p>Swift methods will no longer have auto-generated Objective-C entry points and must have an explicit @objc decorator in order to generate one. The only constructs that will continue to have an implicit bridge are:</p><ul><li>Declarations that override an @objc declaration</li><li>Declarations that satisfy a requirement of an @objc protocol</li><li>Declarations that have @IBAction, @IBInspectable or @IBOutlet</li><li>Declarations that have @NSManaged</li><li>Declarations that have @GKInspectable</li></ul><p><strong>Dynamic</strong> no longer infers @objc.</p><p><strong>NSObject</strong> derived classes no longer infer @objc</p><p>To enable objc for an entire class, its extensions and subclasses, use the new @objcmembers attribute</p><p>To disable @objc conformance for a specific extension or function, add the new @nonobjc attribute.</p><h4><a href="https://github.com/apple/swift-evolution/blob/master/proposals/0156-subclass-existentials.md">Class and Subtype Existentials</a></h4><p>We can now represent existential in Swift for all types, not just protocols.</p><p>Previously, we could represent existential protocol conformance as such:</p><p>Protocol1 &amp; Protocol2 &amp; Protocol3</p><p>We can now represent this for classes:</p><p>NSObject &amp; UITableView &amp; NSCodable &amp; Presentable</p><h4><a href="https://github.com/apple/swift-evolution/blob/master/proposals/0143-conditional-conformances.md">Conditional Conformances</a></h4><p>Generic types can now conform to a particular protocol when its type arguments meet certain requirements.</p><p>For example:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a45c41082d785a0cc621aa956b3852cc/href">https://medium.com/media/a45c41082d785a0cc621aa956b3852cc/href</a></iframe><h4><a href="https://github.com/apple/swift-evolution/blob/master/proposals/0148-generic-subscripts.md">Generic Subscripts</a></h4><p>Subscripts and return types can now be generic.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1a2880414e39e705d9ff151cbb4d8ad9/href">https://medium.com/media/1a2880414e39e705d9ff151cbb4d8ad9/href</a></iframe><h4>One sided Range:</h4><p>You can use one sided ranges now, like so:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ed4cdd370c63a8a45cc7a9b967e96127/href">https://medium.com/media/ed4cdd370c63a8a45cc7a9b967e96127/href</a></iframe><h4><a href="https://github.com/apple/swift-evolution/blob/master/proposals/0163-string-revision-1.md">Better Strings</a></h4><p>Strings now conform to Collection protocol, and provide all of the awesome functions and properties of that protocol:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/0332f8dc4b9ddd1431997320c469a825/href">https://medium.com/media/0332f8dc4b9ddd1431997320c469a825/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=21b77b02040c" width="1" height="1" alt=""><hr><p><a href="https://medium.com/building-vts/whats-new-in-swift-4-21b77b02040c">What’s New in Swift 4</a> was originally published in <a href="https://medium.com/building-vts">Building VTS</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Lessons Learned Integrating Danger and SwiftLint]]></title>
            <link>https://medium.com/building-vts/lessons-learned-integrating-danger-and-swiftlint-4683aecef830?source=rss-6f7f89dffe94------2</link>
            <guid isPermaLink="false">https://medium.com/p/4683aecef830</guid>
            <category><![CDATA[swift]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[code-review]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[continuous-integration]]></category>
            <dc:creator><![CDATA[Hesham Salman]]></dc:creator>
            <pubDate>Wed, 17 May 2017 13:01:02 GMT</pubDate>
            <atom:updated>2018-04-10T13:57:40.034Z</atom:updated>
            <content:encoded><![CDATA[<h3>Running SwiftLint in Continuous Integrations</h3><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*OdLL0-NGiyBgky6J1_m1Xw.png" /></figure><p>At VTS, we care <em>a lot</em> about code quality. We recently started using <a href="http://danger.systems/">Danger</a> to automate some of our processes during code review — including some of our (my) goofier processes, like <a href="https://github.com/valeriomazzeo/danger-the_coding_love">posting a random gif</a> to every pull request.</p><p>Most notably, we’ve setup SwiftLint in our CI environment through Danger, and set up a bot to post a comment with all warnings/errors for files touched in a pull request.</p><h4>Integrating SwiftLint Into a Project</h4><p>SwiftLint is a static analysis tool that can be used to setup rules to find style violations, breaks with convention, and some more serious issues (possible reference cycles, etc…). It can be set up to report within Xcode itself, leveraging Xcode’s warnings and errors to notify you of issues.</p><p>Setting it up is relatively easy — begin by creating a .swiftlint.yml file, and filling it up with some rules. As an example, here’s a slightly modified version of ours:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9de48e68a9bbdebd66116ece7253b32a/href">https://medium.com/media/9de48e68a9bbdebd66116ece7253b32a/href</a></iframe><p>Once that file is created and placed in the top-level-directory of your project, we only have to do two more things:</p><ul><li>Install SwiftLint, either <a href="https://github.com/realm/SwiftLint#installation">through home-brew or as a CocoaPod</a></li><li>Create a run script in the Build Phases section of our project, with script for the <a href="https://github.com/realm/SwiftLint#xcode">home-brew installed version</a> or the <a href="https://github.com/realm/SwiftLint#xcode">CocoaPods installed version</a></li></ul><p><em>Voila!</em></p><p>We should now be able to see SwiftLint run in our Xcode project.</p><p>But in order to make it <em>really</em> useful, we’re going to need this to run in the context of our continuous integration environment.</p><p>Enter: Danger</p><h4>Danger</h4><p><a href="https://github.com/danger/danger">Danger</a> is a tool created by <a href="http://orta.io/">Orta Therox</a> and <a href="https://juanitofatas.com/">Juanito Fatas</a> for automating tasks during code review. In order to get it going, make sure you gem install danger in the setup phase of your CI script, and that you call danger before you run your tests. You’re also going to need a Dangerfile in order to have your configuration, so let’s take a look at a modified version of ours to start:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/47406bfe31f906cc244ea4cc1805b1c3/href">https://medium.com/media/47406bfe31f906cc244ea4cc1805b1c3/href</a></iframe><p>This is a very basic configuration that should just let you know if a PR is a bit large and if it’s tagged as a work in progress. This will become much more useful once we integrate SwiftLint into it.</p><p>To integrate SwiftLint, let’s begin by going to our CI script and adding gem install danger-swiftlint to our setup. Next, let’s add this script to our scripts directory (or similar) and call it in our CI setup with ruby scripts/generate_ci_yaml.rb :</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/27ee155245a70001349a1f725d47ddd4/href">https://medium.com/media/27ee155245a70001349a1f725d47ddd4/href</a></iframe><p>This script takes a copy of our SwiftLint configuration, strips our includes, and then spits out a copy of that file. The reason that we want to do this is so that we only lint the files that we’ve touched, instead of <em>all</em> of them.</p><p>In our Dangerfile, we’re going to append just two more lines:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e57ce501bcfa5cd12825f5b59e941cfd/href">https://medium.com/media/e57ce501bcfa5cd12825f5b59e941cfd/href</a></iframe><p>At this point, we’re running Swiftlint in the context of danger, but the output is confined to our CI environment.</p><p>Danger is most effective if there’s <a href="http://danger.systems/guides/getting_started.html#creating-a-bot-account-for-danger-to-use">an organization bot account for Danger to use</a>. This allows your bot to post a comment to your PR, like so:</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*gtmy32qz7e6Bp03TgaOAhw.png" /></figure><h4>Immediate Results</h4><ol><li>Developers started fixing more SwiftLint issues — we have cleaner code now!</li><li>We started splitting up large pull requests into smaller ones.</li><li>We started integrating more rules into our Dangerfile — we’re currently setting up CodeCoverage comparison of lines/files you touched vs master through <a href="https://github.com/nakiostudio/danger-xcov">danger-xcov</a> and <a href="https://github.com/jonallured/danger-commit_lint">linting our commit messages</a> with regard to our engineering guidelines.</li></ol><h4>More Links:</h4><ul><li><a href="http://danger.systems/guides/getting_started.html#setting-up-danger-to-run-on-your-ci">Setting up Danger on your specific CI</a></li><li><a href="https://github.com/realm/SwiftLint">SwiftLint Docs</a></li></ul><p>For more content, follow me on Medium or on Twitter @_hsalman</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4683aecef830" width="1" height="1" alt=""><hr><p><a href="https://medium.com/building-vts/lessons-learned-integrating-danger-and-swiftlint-4683aecef830">Lessons Learned Integrating Danger and SwiftLint</a> was originally published in <a href="https://medium.com/building-vts">Building VTS</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Idiomatic Swift: Safer View & View Controller Instantiation]]></title>
            <link>https://medium.com/building-vts/idiomatic-swift-safer-view-view-controller-instantiation-ab0c7f41245b?source=rss-6f7f89dffe94------2</link>
            <guid isPermaLink="false">https://medium.com/p/ab0c7f41245b</guid>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[swift]]></category>
            <category><![CDATA[ios-development]]></category>
            <category><![CDATA[open-source]]></category>
            <dc:creator><![CDATA[Hesham Salman]]></dc:creator>
            <pubDate>Tue, 16 May 2017 12:31:04 GMT</pubDate>
            <atom:updated>2018-04-10T13:57:19.283Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MEreIConcKflG2kWYiVUjQ.jpeg" /></figure><p>As Objective-C &amp; Swift developers, we have to be a bit more concerned about nullability than our friends that work in dynamically typed languages. In the Swift community, we generally avoid bangs (!) wherever possible — allowed only in special circumstances like cell dequeueing:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/17e9a9c53163bb77a3b2ba23d09d5360/href">https://medium.com/media/17e9a9c53163bb77a3b2ba23d09d5360/href</a></iframe><p>Why have we accepted this as <em>okay</em> in the community? The need to crash the application here is understandable: we’re missing a view in our application, and by all means this should be a fatal error, but the usage of ! is visually jarring, and throws a <a href="https://github.com/realm/SwiftLint">SwiftLint</a> (or <a href="https://github.com/sleekbyte/tailor">Tailor</a>) warning. In many projects — especially, those that use a linter like SwiftLint or Tailor — we avoid this by guarding and calling fatalError:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b5947714c47514c4ed4a01b7d8e3f855/href">https://medium.com/media/b5947714c47514c4ed4a01b7d8e3f855/href</a></iframe><p>This is awesome for getting an explicit error out of the compiler, for killing the SwiftLint warning generated by the use of a bang, and for avoiding the force unwrap while still initiating a crash if needed. However, it’s hampered by two issues:</p><ul><li>Manually writing an error on every potential failure point is tedious, and it’s easy for developers to do so.</li><li>Passing in a string identifier to dequeue a cell, header, or footer is error prone and can lead to deviations from the convention of matching identifiers to class names.</li></ul><p>Let’s explore a better way.</p><h4>Introducing: <a href="https://github.com/heshamsalman/ReusableViews">ReusableViews</a></h4><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f21a3f221bde32613868ebfae472e198/href">https://medium.com/media/f21a3f221bde32613868ebfae472e198/href</a></iframe><p><a href="https://github.com/heshamsalman/ReusableViews">ReusableViews</a> is a library, available through CocoaPods, that takes <a href="https://medium.com/@gonzalezreal/ios-cell-registration-reusing-with-swift-protocol-extensions-and-generics-c5ac4fb5b75e">Guille Gonzalez’ concept</a> of cleanly and safely dequeueing UITableViewCells to its logical conclusion: allowing idiomatic reuse and registration of all dequeue-able types, as well as clear instantiation of view controllers from storyboards.</p><p>At its core, <a href="https://github.com/heshamsalman/ReusableViews">ReusableViews</a> is a syntactic sugar library. But in practice, it feels like part of Apple’s API. It allows you to express which class you’re trying to instantiate by passing in the <em>type </em>instead of a string identifier. When something goes wrong through its usage, you get a descriptive error telling you <em>what</em> went wrong, instead of EXC_BAD_ACCESS. And finally, because it relies on classes having identifiers that match their class name, it allows your team to follow an easy convention.</p><p>Showcased above, you can use the as syntax to instantiate an object, or you can declare its type as you instantiate it — you can use the syntax that your team prefers. <em>And</em>, this isn’t limited to programmatic views or storyboard-backed views — this works for nib-based views as well, provided that they inherit from NibLoadableView.</p><p>And, perhaps most importantly, when using this library, there is no longer <strong>any</strong> reason to use a force unwrap.</p><h4>Contributing and Installing</h4><p><a href="https://github.com/heshamsalman/ReusableViews">ReusableViews</a> is available on GitHub, production-ready, documented, well-tested, and open to new contributors.</p><p>For more content, follow me on Medium or on Twitter @_hsalman</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ab0c7f41245b" width="1" height="1" alt=""><hr><p><a href="https://medium.com/building-vts/idiomatic-swift-safer-view-view-controller-instantiation-ab0c7f41245b">Idiomatic Swift: Safer View &amp; View Controller Instantiation</a> was originally published in <a href="https://medium.com/building-vts">Building VTS</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Swift 3 Pattern Matching]]></title>
            <link>https://medium.com/building-vts/swift-3-pattern-matching-e9945d2f4517?source=rss-6f7f89dffe94------2</link>
            <guid isPermaLink="false">https://medium.com/p/e9945d2f4517</guid>
            <category><![CDATA[ios-development]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[swift]]></category>
            <category><![CDATA[ios-app-development]]></category>
            <dc:creator><![CDATA[Hesham Salman]]></dc:creator>
            <pubDate>Wed, 08 Mar 2017 20:31:16 GMT</pubDate>
            <atom:updated>2018-04-10T13:56:57.465Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/693/1*nsPddn7l4D26NpiLs2nz9A.jpeg" /></figure><p>Nearly two years ago, Natasha the Robot published a short blog about <a href="https://www.natashatherobot.com/swift-2-pattern-matching-with-if-case/">pattern matching with the if case</a>. While it provided an awesome intro into the if case, it was just that: an intro.</p><p>By the end of this blog, you’ll be able to match &amp; filter circles around your non-case using colleagues.</p><h4>The Example</h4><p>VTS is a commercial real estate technology company — and as such, we’re going to use a building themed example.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ab1e59e72079c0000473382b7c6a25dd/href">https://medium.com/media/ab1e59e72079c0000473382b7c6a25dd/href</a></iframe><p>In the above example, we have a number of building types with associated values. Enums with associated values can really clean up closely related class objects — and keep you from making mistakes in your state machines.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/962ab545498168802e33acc16416db2c/href">https://medium.com/media/962ab545498168802e33acc16416db2c/href</a></iframe><p>Above is effectively the equivalent of Natasha’s example — simple and to the point. It allows us to match enumerations based on a single case, and create a localized variable of the field we’re looking to work with. It allows us to switch on a single case of the enumeration without using a verbose switch with default. We can also have conditional matching based on internal fields:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7adc36966a5b05386911da0d3f91e117/href">https://medium.com/media/7adc36966a5b05386911da0d3f91e117/href</a></iframe><p>Because we can use if case let, we can also use guard case let in a similar way. But, most importantly, we can combine this with a for loop:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7efbde72ab31641f11fb58babd171274/href">https://medium.com/media/7efbde72ab31641f11fb58babd171274/href</a></iframe><p>Combining it with a for loop in this way allows us to filter and match over a collection. This lets us perform powerful filtering techniques in an easy-to-read fashion.</p><h3>Further Reading</h3><p><a href="https://appventure.me/2015/08/20/swift-pattern-matching-in-detail/">Match Me If You Can</a>, by AppVenture</p><p><a href="https://developer.apple.com/library/content/documentation/Swift/Conceptual/Swift_Programming_Language/Patterns.html">Pattern Match Operator</a>, Swift Documentation</p><p><a href="https://oleb.net/blog/2015/09/swift-pattern-matching/">Swift Pattern Matching</a>, Ole Begemann</p><p>For more content, follow me on Medium or on Twitter @_hsalman</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e9945d2f4517" width="1" height="1" alt=""><hr><p><a href="https://medium.com/building-vts/swift-3-pattern-matching-e9945d2f4517">Swift 3 Pattern Matching</a> was originally published in <a href="https://medium.com/building-vts">Building VTS</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Advanced Swift Protocols]]></title>
            <link>https://medium.com/building-vts/advanced-swift-protocols-d683cae12caf?source=rss-6f7f89dffe94------2</link>
            <guid isPermaLink="false">https://medium.com/p/d683cae12caf</guid>
            <category><![CDATA[swift]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[ios-development]]></category>
            <category><![CDATA[ios-app-development]]></category>
            <category><![CDATA[swift-programming]]></category>
            <dc:creator><![CDATA[Hesham Salman]]></dc:creator>
            <pubDate>Fri, 03 Mar 2017 14:38:07 GMT</pubDate>
            <atom:updated>2018-04-10T13:56:39.482Z</atom:updated>
            <content:encoded><![CDATA[<p>When Dave Abrahams introduced protocol-oriented programming in a <a href="https://developer.apple.com/videos/play/wwdc2015/408/">renowned WWDC talk</a>, he introduced himself as <em>professor of blowing your mind</em>.</p><p>Protocol oriented programming is certainly mind-blowing, and you can do amazing things with it — but it certainly has its limits in the current version of Swift (3.0.2).</p><p>For the uninitiated, protocol oriented programming is a technique that favors focusing on the <em>behaviors</em> of an object and moving those behaviors to a reusable protocol.</p><h4>Our Example Project: Animalia</h4><p>If we were to write an animal cataloguing system for a zoo, we’d want to approach it thinking of the generic properties and behaviors of Animals. Instead of beginning with a base class and beginning an inheritance chain, we’d start with a protocol.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2c1336d48386201b75efd2c02e458acc/href">https://medium.com/media/2c1336d48386201b75efd2c02e458acc/href</a></iframe><p>Since protocol types are first class citizens in Swift, we can refer to Animal as if it were a base class. Note that the WaterBreathable protocol implies Swimmable, and that a chained protocol of this sort is fine.</p><p>At this point, we could go ahead and start defining many animals. But, before we start making our structs, we should being by defining a few general types of animals, such as birds and mammals.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e6b8d6fe9fbd076604c7e0cf28da11ab/href">https://medium.com/media/e6b8d6fe9fbd076604c7e0cf28da11ab/href</a></iframe><blockquote>Extensions? Self? What’s happening up there?</blockquote><p>Glad you asked, reader. Instead of forcing all these types to conform to Animal — we’re just implementing these default behaviors to these classes in the case that they are <em>also</em> Animal. Byusing this pattern, that we can continue defining default behaviors for Animal. This also means that our extensions impose a Self requirement, even though our protocol doesn’t.</p><blockquote>Okay, sure. But snakes don’t have two limbs.</blockquote><p><a href="https://en.wikipedia.org/wiki/Snake">Yes they do.</a></p><p>Using our new library of protocols, we can begin defining our animal types.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3f51b8d8c12304a304c0400761b41e51/href">https://medium.com/media/3f51b8d8c12304a304c0400761b41e51/href</a></iframe><p>Wow, look at that! We don’t have to fill out a body for these structs because their behaviors are already implemented by their backing protocols.</p><h4>Associated Types</h4><p>So after we take this all to production, we start notice that our cows and lions are dying out because we haven’t catalogued their dietary requirements. Whoops. Let’s fix that right now.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a29d7eea51c03de15df8c7fbfc0168f2/href">https://medium.com/media/a29d7eea51c03de15df8c7fbfc0168f2/href</a></iframe><p>We’ve defined a protocol, Food, and its companion types: Meat, and Grass. We’ve also updated our Animal object to eat a type of Food. But, with this implementation, we realize a problem: Cows don’t eat Food; they eat Grass. Similarly, lions don’t eat generic Food, they eat Meat.</p><p>In OOP languages, such as Java, we may do something like this in our implementations of Animal:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ef73fd569a44d064903d384341c187b9/href">https://medium.com/media/ef73fd569a44d064903d384341c187b9/href</a></iframe><p>This seems inadequate — not only because it doesn’t represent the relationship between animals and food, but also because we are expecting the users of these classes to know the foods appropriate for each animal.</p><p>Swift allows an alternative approach, involving the oft-maligned associatedtype keyword. An associated type is a placeholder type within a protocol. Implementing associated types allow you to use a “generic” type in your protocol but be warned, they are not <em>quite</em> generic protocols, nor do they come without drawbacks. When using a protocol with an associated type, you will lose the ability to use that protocol as a type. You’ll <em>only</em> be able to use it as a generic constraint. You’ll also lose the ability to use the protocol in a heterogeneous collection; you can no longer have an array of Animal objects, but you’ll be able to have an array of Lion objects.</p><p>Let’s explore this solution:</p><p>First, we’ll update our Animal protocol to include an associated type:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/661f580e54133a848412f87730e65f5f/href">https://medium.com/media/661f580e54133a848412f87730e65f5f/href</a></iframe><p>Let’s assume that instead of having <em>just</em> Cow and Lion, that we had <em>hundreds</em> of Animals. Manually implementing an eat function on possibly hundreds of types is cumbersome, so let’s use protocols to circumvent that.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ea7de70d15ab5c64c5045fc5e575a85f/href">https://medium.com/media/ea7de70d15ab5c64c5045fc5e575a85f/href</a></iframe><p>At this point, we just have to decide what kinds of eaters our existing animals are — A much easier task than manually implementing a function across multiple types!</p><h4>Typealiases</h4><p>After defining several more animals, such as Eagle, Tiger, Hawk, Gorilla, and Monkey, we may find that we’re using a lot of the same patterns. We can chain protocols together in type aliases to shortcut the process of declaring new animals.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/66125d5cf8483dc32f34b55c9132f2d2/href">https://medium.com/media/66125d5cf8483dc32f34b55c9132f2d2/href</a></iframe><p>Using a protocol-first methodology can be very powerful.</p><p>But, as mentioned earlier, associatedtype can have some far reaching implications.</p><h4>Avoiding the Pitfalls of Associated Types</h4><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*ykUDuOrDL1sf2kqETBPN6g.png" /></figure><p>The table above quickly outlines the difference between protocols with and without self requirements. The most potentially problematic of these is the second point: ‘Think homogenous’.</p><p>This point implies that we cannot have arrays of the generic Animal type. The reason why is quite simple: Animal, as a protocol is not just defined by being an animal, but also by its <em>association</em>; there is no such thing as an Animal, but there is an Animal&lt;Grass&gt;.</p><p>You can take multiple routes to get around this problem.</p><h4>Generic Functions</h4><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/4d576e73a7bf2b0182f7ff9b47dd13ec/href">https://medium.com/media/4d576e73a7bf2b0182f7ff9b47dd13ec/href</a></iframe><p>Using generic functions in this manner, we can have the same API for the different types so that the end user doesn’t <em>feel</em> impacted by associated types. This is a common pattern throughout the Swift standard library. It’s also a clearly repetitive and cumbersome pattern — although it is the most effective and generally applicable.</p><h4>Type Erasures</h4><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ee7953431ca21f9029d866a77fd075f7/href">https://medium.com/media/ee7953431ca21f9029d866a77fd075f7/href</a></iframe><p>Type erasures are a complex pattern that’s used <em>all over</em> the Swift standard library. They are, however, very limited. In this instance, the AnyAnimal wrapper allows you to wrap any types of animals together to have an array of them, but will no longer conform to its wrapped object’s protocols.</p><p>If you had an Eagle, e, and a wrapped eagle w of type AnyAnimal(Eagle, it canFly. However, it is not Flyable. Not an ideal solution if your methods rely on prototypical conformance to function.</p><h4>Wait For The Next Major Swift Release</h4><p>Swift 4 is likely to support covariance, which removes a lot of the limitations of protocols with an associated type. In fact, they’re planning on improving Swift support for Generics as a whole in order to avoid some of the workarounds used in the standard library.</p><p>To see the full code sample used in this project, check out the <a href="https://github.com/heshamsalman/Animalia">Animalia GitHub repo</a>.</p><p>For more content, follow me on Medium or on Twitter @_hsalman</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d683cae12caf" width="1" height="1" alt=""><hr><p><a href="https://medium.com/building-vts/advanced-swift-protocols-d683cae12caf">Advanced Swift Protocols</a> was originally published in <a href="https://medium.com/building-vts">Building VTS</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Escaping & Non-Escaping Closures, Memory Management, and You]]></title>
            <link>https://medium.com/building-vts/escaping-non-escaping-closures-memory-management-and-you-cb936c60a9d1?source=rss-6f7f89dffe94------2</link>
            <guid isPermaLink="false">https://medium.com/p/cb936c60a9d1</guid>
            <dc:creator><![CDATA[Hesham Salman]]></dc:creator>
            <pubDate>Mon, 27 Feb 2017 18:12:08 GMT</pubDate>
            <atom:updated>2018-04-10T13:56:06.726Z</atom:updated>
            <content:encoded><![CDATA[<p>If you’re new to Swift, or you’re new to Swift 3, you may have noticed that some closures now have a new keyword: escaping. Many of us were caught off-guard by this new addition — what even <em>is</em> an escaping closure? And if there’s an escaping closure, surely there must be a <em>non</em>-escaping closure.</p><h4>Non Escaping Closures</h4><p>Non-escaping closures have a very clear lifecycle and have become the default closure type in Swift 3 because of it. A non-escaping closure is simple: It’s passed into a function (or other containing scope), the function/scope executes that closure, and the function returns. The closure cannot return or finish executing <em>after</em> the body of the calling function has returned. Due to that fact, the compiler is able to optimize non-escaping closures over escaping closures.</p><h4>Escaping Closures</h4><p>Escaping closures are more complex — they’re named that way because their return can <em>escape</em> the body of the calling function; the closure can be stored somewhere that will be retained after the calling function has finished executing.</p><p>Common use cases for this are:</p><ol><li>Asynchronous calls; networking.</li><li>Functions stored as variables; think actions and supplied callbacks.</li><li>Scheduling tasks on a dispatch queue.</li></ol><h4>Exceptions</h4><p>Closures in Swift are non-escaping by default — except when they’re not.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1143ae640f2668acbd20cf1e1d2f117b/href">https://medium.com/media/1143ae640f2668acbd20cf1e1d2f117b/href</a></iframe><p>Functions that are stored as variables are escaping — by definition, they are retained after they are executed, and can be executed multiple times.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/60476b89b7b2874c331a315c20de391c/href">https://medium.com/media/60476b89b7b2874c331a315c20de391c/href</a></iframe><p>All optional closures are escaping. Technically, when being used as an optional, it’s a parameter of the <em>optional</em> type: Optional&lt;() -&gt; (Optional&lt;StatusEffect&gt;, Damage).</p><p>In fact, all closures parameterized in this manner are escaping, such as when being used in:</p><ul><li>enums</li><li>tuples</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/154bb9e5469720c59fb767fdadb77c84/href">https://medium.com/media/154bb9e5469720c59fb767fdadb77c84/href</a></iframe><p>Typealiased function types are also treated as escaping types, but it seems as though that’s not intentional behavior. There’s been <a href="https://bugs.swift.org/browse/SR-2316">a bug fix</a> submitted but there’s no word yet about whether or not it’s live in the current version of Swift. Expect it to be live by Swift 3.1.</p><h4>Okay, so what’s it matter?</h4><p>Knowing the retain/release cycle of a closure at compile time can lead to measurable performance improvements; a non-escaping closure can guarantee that it will have released all objects it captured by the time the function returns. The compiler can omit some retain and release calls if it knows about the lifetime of the closure.</p><p>Furthermore, it’s <em>troublingly easy</em> to introduce a <a href="https://developer.apple.com/library/content/documentation/Swift/Conceptual/Swift_Programming_Language/AutomaticReferenceCounting.html#//apple_ref/doc/uid/TP40014097-CH20-ID56">reference cycle</a> into your application through an escaping closure.</p><h4>Identifying Reference Cycles</h4><p>If your go-to reaction is to refer to instance variables within a closure with self, you could be hiding a reference cycle. Any reference to self within a closure should be a reference to unowned self or weak self to prevent a reference cycle. Note that non-escaping closures don’t require a reference to self:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3147d72d9791e0c0f810a2d07ced49ed/href">https://medium.com/media/3147d72d9791e0c0f810a2d07ced49ed/href</a></iframe><p>In the above example, the compiler doesn’t complain about not using self because there is <em>no</em> reference cycle possible: the closure is non-escaping and is destroyed once its calling function returns.</p><p>The main things to watch out for when using closures are:</p><ol><li>Assigning a closure to a property of a class instance wherein the body of that closure captures the instance.</li><li>Assigning a free-form closure to a property — essentially the same as above but the interaction is between a closure and an instance instead of two instances.</li></ol><p>Simple Example of Case 1:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/358fcb56d9ace8a115a823c02cda43c8/href">https://medium.com/media/358fcb56d9ace8a115a823c02cda43c8/href</a></iframe><p>In the above case, parent owns a reference to child, whose closure owns a reference to parent through the use of self. Even if child were optional and its value was assigned to nil, it would not free up that memory due to the reference cycle.</p><p>Simple Example of Case 2:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f7fb5fa759944bbbce8f907f6c1a33d5/href">https://medium.com/media/f7fb5fa759944bbbce8f907f6c1a33d5/href</a></iframe><p>In the above case, the default implementation of the worderizedValue makes a reference to self — this keeps both the closure and the instance alive even though the variable pointing to the instance was then made nil .</p><h4>Weak vs unowned</h4><p>Apple largely prefers the use of unowned over weak for most closures. Defining self as unowned means that both the instance and the capturer will be deallocated at the same time. Defining a capture as weak means that the captured reference could become nil at some point in the future — the two are not deallocated simultaneously.</p><h4>How do I use this new information?</h4><p>We write closures every day. Use this information to guide your choices about how you should structure your closure, and what you should do to prevent a reference cycle.</p><p>In my next post, I’ll talk about how to use the Xcode Instruments to identify, diagnose, and fix a reference cycle.</p><p>For more content, follow me on Medium or on Twitter @_hsalman</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cb936c60a9d1" width="1" height="1" alt=""><hr><p><a href="https://medium.com/building-vts/escaping-non-escaping-closures-memory-management-and-you-cb936c60a9d1">Escaping &amp; Non-Escaping Closures, Memory Management, and You</a> was originally published in <a href="https://medium.com/building-vts">Building VTS</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A (mostly) comprehensive list of Swift 3.0 and 2.3 changes]]></title>
            <link>https://medium.com/building-vts/a-mostly-comprehensive-list-of-swift-3-0-and-2-3-changes-193b904bb5b1?source=rss-6f7f89dffe94------2</link>
            <guid isPermaLink="false">https://medium.com/p/193b904bb5b1</guid>
            <category><![CDATA[swift-3]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[swift]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[apple]]></category>
            <dc:creator><![CDATA[Hesham Salman]]></dc:creator>
            <pubDate>Wed, 31 Aug 2016 17:54:41 GMT</pubDate>
            <atom:updated>2019-06-10T15:41:59.425Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*25XHpf3-pneK5irc56UZag.png" /></figure><h4>Reminder: Swift still isn’t ABI-Stable!</h4><p>Before we get this going, I’d just like to remind everyone that Swift is still not ABI stable. That means that binaries created with previous versions of Swift aren’t compiler-friendly with the current version. In plain English, this means that all of your files and dependencies have to be compiled with the same version of Swift; you cannot mix and match code written in different version of Swift.</p><p>Apple is trying to mitigate this by making Swift 3.0 the last version with (major) breaking changes (no promises). ABI stability is slated for Swift 4.</p><h4>Should you upgrade to 2.3 or 3.0?</h4><p>If you have a significant Swift code base — as we do here at VTS — the answer to this is:</p><blockquote>yes, both.</blockquote><p>If your Swift code base isn’t massive, then you should skip 2.3 and jump to 3.0.</p><p>Here are a few things to keep in mind:</p><ol><li>Dependencies are important. Make sure to check if your dependencies support Swift 2.3 or Swift 3.0 — most major libraries/frameworks support both (Alamofire, Charts). However, something to keep in mind is that the upgrade to 3.0 is one way only. Since new development in Swift is going to take place in Swift 3.0, the 2.3 versions of all your dependencies are likely going to be frozen with <em>no updates</em>.</li><li>Some version <em>8.x</em> of Xcode will remove support for Swift 2.3. Swift 2.3 is intended to be an intermediate step for larger projects that will need a longer effort to upgrade to 3.0.</li><li>If you have private CocoaPods that are shared across multiple projects, you will have to upgrade those first.</li></ol><p>You can upgrade to 2.3, but you’ll be delaying the inevitable: You’ll still have to migrate to Swift 3 before the release of Xcode 9.</p><h4>Migration Issues from Swift 2.2 to 2.3</h4><p>The migrator might migrate Range&lt;T&gt; to CountableRange&lt;T&gt;. CountableRange&lt;T&gt; only exists in Swift 3.</p><p>The migrator will add the comment /*Migrator FIXME: Use a variable of type DispatchSpecificKey*/ to uses of dispatch_queue_set_specific(). This is only relevant for a future migration to Swift 3.</p><h4>Migration Issues from 2.x to 3.0</h4><p>Version 3.0 of Swift is the “break everything” release. Swift 3 is meant to break everything and get rid of anything that isn’t beneficial to the language long-term. That means a lot of things are going to change, and you’re going to have to change <em>a lot of things</em> to make your projects compliant.</p><h3>Swift 2.3</h3><p>Swift 2.3 is a <em>very</em> minor update. How minor? Effectively, there’s only one change: compile-time nullability checks of Objective-C code in updated Apple SDKs.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3bffba5a89e5c5c339e36e50bbb4e027/href">https://medium.com/media/3bffba5a89e5c5c339e36e50bbb4e027/href</a></iframe><p>Other changes include some minor renaming and many optional initializers are now returning their intended object instead of optionals. This applies to things like instantiating nibs from a bundle.</p><h3>Swift 3.0</h3><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*Tl4iRaLbz2jd1HNmkDtWWA.jpeg" /></figure><h4>Major Changes (things you may notice)</h4><p><strong>The definition of private has changed and the introduction of fileprivate</strong></p><p>What was formerly private is now fileprivate. A fileprivate variable can be accessed within an extension. A private variable cannot be accessed within an extension to a class.</p><p><a href="https://github.com/apple/swift-evolution/blob/master/proposals/0025-scoped-access-level.md">Learn more about this change</a></p><p><strong>The definition of public has changed and the introduction of open</strong></p><p>Currently, declaring a class or parameter public provides two capabilities:</p><ol><li>It allows external modules to use the class/member.</li><li>It allows external modules to override the class/member.</li></ol><p>In Swift 3, public means externally usable, but not overridable. The previous functionality is encapsulated by open.</p><p><a href="https://github.com/apple/swift-evolution/blob/master/proposals/0117-non-public-subclassable-by-default.md">Learn more about this change</a></p><p><strong>Verbs and nouns</strong></p><p>Functions that end in -d are returning a new instance of that object.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/190c7cd3f3022da79a7820da287d5b96/href">https://medium.com/media/190c7cd3f3022da79a7820da287d5b96/href</a></iframe><p>This change applies to reverse and reversed, enumerate and enumerated, etc…</p><p>Objective-C booleans are now prepended with the word <em>is</em> and Foundation types no longer have the NS-prefix (where there is no conflict — for example, NSString still has the prefix, because it would otherwise conflict with String).</p><p><strong>Foundation types now play nicely with Swift’s let and var declarations.</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d63a8ad1a0f102a764ca69e9397602b8/href">https://medium.com/media/d63a8ad1a0f102a764ca69e9397602b8/href</a></iframe><p><a href="https://github.com/apple/swift-evolution/blob/master/proposals/0069-swift-mutability-for-foundation.md">Learn more about this change</a></p><p><strong>Import as member</strong></p><p>Annotated C functions are imported as methods. The importer can usually infer these mappings automatically, and it means that using old C-APIs feels natural and <em>native</em> to Swift. Case and point, the CoreGraphics API. CoreGraphics had <em>not</em> been updated in this release (aside from annotations).</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1f4f96359444e9d3ff62014b17497a64/href">https://medium.com/media/1f4f96359444e9d3ff62014b17497a64/href</a></iframe><p><a href="https://github.com/apple/swift-evolution/blob/master/proposals/0044-import-as-member.md">Read more about this change</a></p><p><strong>Camel casing changes</strong></p><p>UpperCamelCase has been replaced with lowerCamelCase in enumerations and properties that start with an acronym.</p><pre>// Before<br>let red = UIColor.redColor().CGColor<br>// After<br>let red = UIColor.red.cgColor</pre><p><strong>(My least favorite change) Restructured condition clauses</strong></p><p>You can no longer use the where keyword in guard, if, and while statements. The where keyword still applies to for loops in the form of for-in-where.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c6c2945640ae71b9426334ac9a1fb8aa/href">https://medium.com/media/c6c2945640ae71b9426334ac9a1fb8aa/href</a></iframe><p>Also has some changes on the case clauses.</p><p><a href="https://github.com/apple/swift-evolution/blob/master/proposals/0099-conditionclauses.md">Learn more about this change</a></p><p><strong>Consistent first argument labels</strong></p><p>Pretty easy to understand this one: first parameter names are now required by default.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a7a8b2d1844c9cbe976ab4463f5b8374/href">https://medium.com/media/a7a8b2d1844c9cbe976ab4463f5b8374/href</a></iframe><p><a href="https://github.com/apple/swift-evolution/blob/master/proposals/0046-first-label.md">Learn more about this change.</a></p><p><strong>(My favorite change) Handling implicitly unwrapped optionals</strong></p><p>I think this change alone is worth the migration process if you have a shared-language project. So what is it?</p><p>Objective-C types that previously had properties of ImplicitlyUnwrappedType! now have the type WrappedType?. This applies everywhere except this case:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/5971630b3b0a9045825842197c58bc91/href">https://medium.com/media/5971630b3b0a9045825842197c58bc91/href</a></iframe><p><a href="https://github.com/apple/swift-evolution/blob/master/proposals/0054-abolish-iuo.md">Learn more about this change</a></p><p><strong>Better translation of Obj-C APIs</strong></p><p>Naming has been made more clear.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/6cfd3d9864d3eae8acc399f61cf8b7ec/href">https://medium.com/media/6cfd3d9864d3eae8acc399f61cf8b7ec/href</a></iframe><p><a href="https://github.com/apple/swift-evolution/blob/master/proposals/0005-objective-c-name-translation.md">Learn more about this change</a></p><p><strong>Modernized dispatching</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a4ccc86765cae28577bb7b44676d900a/href">https://medium.com/media/a4ccc86765cae28577bb7b44676d900a/href</a></iframe><p><a href="https://github.com/apple/swift-evolution/blob/master/proposals/0088-libdispatch-for-swift3.md">Learn more about this change</a></p><p><strong>Collection Types have a new model.</strong></p><p>Previously, when you wanted to traverse from one index to another in a collection type, you would use the successor method of the index. Now, that responsibility has been moved to the collection, such that now you write c.index(after: index). Collections may now have an index of any Comparable type.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a4359c13e7939d348883a83e349157f2/href">https://medium.com/media/a4359c13e7939d348883a83e349157f2/href</a></iframe><p>(The following part only applies if you manually create Range objects. I don’t think any of us do)</p><p>As a side effect of this change, Range has been split into multiple types: Range, ClosedRange, CountableRange, and CountableClosedRange. ClosedRange now includes ranges that span the maximum value of a type (0…Int8.max). Range and ClosedRange are no longer iterable — they now only require a Comparable object as their bound (so you can create Range&lt;String&gt;).</p><p><a href="https://github.com/apple/swift-evolution/blob/master/proposals/0065-collections-move-indices.md">Learn more about this change.</a></p><p><strong>Objective C’s id is imported as Swift’s Any type</strong></p><p>To quote Apple,</p><blockquote>Since ‘id’ now imports as ‘Any’ rather than ‘AnyObject’, you may see errors where you were previously performing dynamic lookup on ‘AnyObject’.</blockquote><p><a href="https://github.com/apple/swift-evolution/blob/master/proposals/0116-id-as-any.md">Learn more about this change.</a></p><h4>Small Changes (things you may not notice)</h4><p><strong>Optional comparison operators removed</strong></p><p>Currently, nil-types are comparable. Case and point:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/fda672e55f676a07b40c28368d650a5b/href">https://medium.com/media/fda672e55f676a07b40c28368d650a5b/href</a></iframe><p>This makes it really easy to write bugs like this:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ec02a085637adac69404263bb0499fe4/href">https://medium.com/media/ec02a085637adac69404263bb0499fe4/href</a></iframe><p>Now, you’re required to unwrap things before you compare them:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/96a3e6ed914b104756de3b91e40988c1/href">https://medium.com/media/96a3e6ed914b104756de3b91e40988c1/href</a></iframe><p>It’s one of those things that’s a really good idea but will likely demolish your unit tests.</p><p><a href="https://github.com/apple/swift-evolution/blob/master/proposals/0121-remove-optional-comparison-operators.md">Learn more about this change.</a></p><p><strong>Closure parameter names and labels</strong></p><p>A lot of closure parameter names have been renamed or made optional.</p><p>An example:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/6980c34ee76337791a7d6c05c4421b0c/href">https://medium.com/media/6980c34ee76337791a7d6c05c4421b0c/href</a></iframe><p><strong>flatten renamed to joined</strong></p><p><a href="https://github.com/apple/swift-evolution/blob/master/proposals/0133-rename-flatten-to-joined.md">Learn more about this change.</a></p><p><strong>Handling UnsafePointer&lt;T&gt;</strong></p><p>The nullability of non-object pointer types is represented using optionals.</p><p><a href="https://github.com/apple/swift-evolution/blob/master/proposals/0055-optional-unsafe-pointers.md">Learn more about this change.</a></p><p><strong>Rounding floating point values is now the responsibility of the value.</strong></p><p>Previously we would use the global C-functions floor and ceil to round a floating point type. These functions are still available but are being considered for deprecation.</p><p>Instead, we should now do the following:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/0391b4d50527a15beb6b8fdec8281469/href">https://medium.com/media/0391b4d50527a15beb6b8fdec8281469/href</a></iframe><p>There are additional rounding rules, such as:</p><ol><li>toNearestOrAwayFromZero</li><li>toNearestOrEven</li><li>towardZero</li><li>awayFromZero</li></ol><p><a href="https://github.com/apple/swift-evolution/blob/master/proposals/0113-rounding-functions-on-floatingpoint.md">Learn more about this change</a></p><p><strong>Generic type aliases</strong></p><p><a href="https://github.com/apple/swift-evolution/blob/master/proposals/0048-generic-typealias.md">Learn more about this change</a></p><p><strong>Operator declaration syntax change</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/83c7ba7bb8055d83aa15b01a9b036d90/href">https://medium.com/media/83c7ba7bb8055d83aa15b01a9b036d90/href</a></iframe><p><a href="https://github.com/apple/swift-evolution/blob/master/proposals/0077-operator-precedence.md">Learn more about this change</a></p><p><strong>Objective C Constants are now Swift types</strong></p><p>We are no longer using named strings for obj-c inter-op.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2c6f16c691fb9e76dab333409e451eb2/href">https://medium.com/media/2c6f16c691fb9e76dab333409e451eb2/href</a></iframe><p><a href="https://github.com/apple/swift-evolution/blob/master/proposals/0033-import-objc-constants.md">Learn more about this change</a></p><h4>Stuff so small that you probably don’t care</h4><p><strong>NSError has improved bridging</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e783b02db246c316e42e3afb69efd813/href">https://medium.com/media/e783b02db246c316e42e3afb69efd813/href</a></iframe><p><a href="https://github.com/apple/swift-evolution/blob/master/proposals/0112-nserror-bridging.md">Learn more about this change.</a></p><p><strong>nulTerminatedUTF8CString renamed to utf8CString</strong></p><p><a href="https://github.com/apple/swift-evolution/blob/master/proposals/0054-abolish-iuo.md">Learn more about this change</a></p><p><strong>Removal of repeating UnicodeScalar initializer of String</strong></p><p><a href="https://github.com/apple/swift-evolution/blob/master/proposals/0130-string-initializers-cleanup.md">Learn more about this change</a></p><p><strong>Failable UnicodeScalar initializers now return an optional.</strong></p><p><a href="https://github.com/apple/swift-evolution/blob/master/proposals/0128-unicodescalar-failable-initializer.md">Learn more about this change</a></p><p><strong>No more tuple splatting</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/cdc2ffa7f780fe925348dc684c670e18/href">https://medium.com/media/cdc2ffa7f780fe925348dc684c670e18/href</a></iframe><p><a href="https://github.com/apple/swift-evolution/blob/master/proposals/0029-remove-implicit-tuple-splat.md">Learn more about this change</a></p><p><strong>No more currying func declaration syntax.</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8f45b8380d24845ca4e6934eb22ba46e/href">https://medium.com/media/8f45b8380d24845ca4e6934eb22ba46e/href</a></iframe><p><a href="https://github.com/apple/swift-evolution/blob/master/proposals/0002-remove-currying.md">Learn more about this change</a></p><h4>Are these all the changes in Swift 3?</h4><p><strong>NO</strong>.</p><p>There are proposals still under review for this release. Several proposals have been deferred to 3.x, and I’ve also chosen to not include some additions and changes that I felt were very minor — like the removal or merger of some uncommonly used API calls.</p><p>In addition, I haven’t necessarily gone in depth with each of these individual changes, and have instead chosen to give a high-level overview of each change. Some changes have a bit of a ripple effect in their scope, and if you’re interested in the specifics of these changes you should really visit the <a href="https://github.com/apple/swift-evolution">Swift EVO project</a>.</p><p>Changes under active review / awaiting review for this release</p><ol><li><a href="https://github.com/apple/swift-evolution/blob/7fcba970b88a5de3d302d291dc7bc9dfba0f9399/proposals/0100-add-sequence-based-init-and-merge-to-dictionary.md">Add sequence-based initializers and merge methods to Dictionary</a></li><li><a href="https://github.com/apple/swift-evolution/blob/7fcba970b88a5de3d302d291dc7bc9dfba0f9399/proposals/0079-upgrade-self-from-weak-to-strong.md">Allow using optional binding to upgrade self from a weak to strong reference</a></li><li><a href="https://github.com/apple/swift-evolution/blob/7fcba970b88a5de3d302d291dc7bc9dfba0f9399/proposals/0131-anyhashable.md">Add AnyHashable to standard library</a></li></ol><p>Changes deferred to a 3.x release</p><ol><li><a href="https://github.com/apple/swift-evolution/blob/7fcba970b88a5de3d302d291dc7bc9dfba0f9399/proposals/0078-rotate-algorithm.md">Rotate algorithm</a></li><li><a href="https://github.com/apple/swift-evolution/blob/7fcba970b88a5de3d302d291dc7bc9dfba0f9399/proposals/0090-remove-dot-self.md">Removal of .self</a></li><li><a href="https://github.com/apple/swift-evolution/blob/7fcba970b88a5de3d302d291dc7bc9dfba0f9399/proposals/0058-objectivecbridgeable.md">Allow Swift types to provide custom Obj-C representations</a></li><li><a href="https://github.com/apple/swift-evolution/blob/7fcba970b88a5de3d302d291dc7bc9dfba0f9399/proposals/0083-remove-bridging-from-dynamic-casts.md">Remove bridging conversion behavior from dynamic casts</a></li><li><a href="https://github.com/apple/swift-evolution/blob/7fcba970b88a5de3d302d291dc7bc9dfba0f9399/proposals/0132-sequence-end-ops.md">Rationalizing sequence end-operation names</a></li></ol><h4>Bonus:</h4><p>Things I’m sure we’re all glad were rejected:</p><ol><li><a href="https://github.com/apple/swift-evolution/blob/7fcba970b88a5de3d302d291dc7bc9dfba0f9399/proposals/0105-remove-where-from-forin-loops.md">Removal of where from the Swift language</a></li><li><a href="https://github.com/apple/swift-evolution/blob/7fcba970b88a5de3d302d291dc7bc9dfba0f9399/proposals/0009-require-self-for-accessing-instance-members.md">Require self to access instance members</a></li><li><a href="https://github.com/apple/swift-evolution/blob/7fcba970b88a5de3d302d291dc7bc9dfba0f9399/proposals/0119-extensions-access-modifiers.md">Removal of access modifiers from extensions</a></li></ol><p>For more content, follow me on medium or on twitter @_IronHam</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=193b904bb5b1" width="1" height="1" alt=""><hr><p><a href="https://medium.com/building-vts/a-mostly-comprehensive-list-of-swift-3-0-and-2-3-changes-193b904bb5b1">A (mostly) comprehensive list of Swift 3.0 and 2.3 changes</a> was originally published in <a href="https://medium.com/building-vts">Building VTS</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>