<?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 Daniel Williamson on Medium]]></title>
        <description><![CDATA[Stories by Daniel Williamson on Medium]]></description>
        <link>https://medium.com/@danielwilliamson17?source=rss-629bbdc69c38------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*gUV78jsfiXJ5GgXX.</url>
            <title>Stories by Daniel Williamson on Medium</title>
            <link>https://medium.com/@danielwilliamson17?source=rss-629bbdc69c38------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 22:33:20 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@danielwilliamson17/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[UI testing in a snap — iOSSnapshotTestCase]]></title>
            <link>https://medium.com/freelancer-engineering/ui-testing-in-a-snap-iossnapshottestcase-509303283073?source=rss-629bbdc69c38------2</link>
            <guid isPermaLink="false">https://medium.com/p/509303283073</guid>
            <category><![CDATA[swift-programming]]></category>
            <category><![CDATA[swift]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[xctest]]></category>
            <dc:creator><![CDATA[Daniel Williamson]]></dc:creator>
            <pubDate>Tue, 10 Apr 2018 14:04:07 GMT</pubDate>
            <atom:updated>2018-07-08T23:07:02.015Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/921/1*lWlUPrBOQoKCEQbEbFQQaA.png" /><figcaption><a href="https://goo.gl/HJB2bc">https://goo.gl/HJB2bc</a></figcaption></figure><h3>What Is It?</h3><p>Previously known as <strong>FBSnapshotTestCase </strong>and<strong> </strong>currently maintained by Uber,<strong> </strong>this framework creates reference images of <strong>UIViews</strong> and uses them to test subsequent images of the same view to check that they are identical.</p><p><a href="https://github.com/uber/ios-snapshot-test-case">GitHub - uber/ios-snapshot-test-case: Snapshot view unit tests for iOS</a></p><h3>Why would I use it?</h3><p>There are a couple of use cases I have found:</p><h4>Writing UI in code</h4><p>This is a big one for me. Within my team we have been moving away from xibs and Storyboards and creating all of our UI programtically.</p><p>One obvious downside of this is that you can’t see how the UI looks until you run the app.</p><p>Particularly in larger applications this can be cumbersome especially when the screen you want to view is nested deep within the navigation stack.</p><p>By using <strong>iOSSnapshotTestCase </strong>you can check the view by running the test and inspecting the reference image.</p><h4><strong>UITesting</strong></h4><p>Nobody likes writing tests. There are many articles out there outlining the <a href="https://bit.ly/2GAN0uL"><strong>annoyance</strong></a><strong>s</strong>. I found creating tests with <strong>iOSSnapshotTestCase </strong>relatively simple.</p><h3>Example</h3><p>After the <a href="https://github.com/uber/ios-snapshot-test-case#installation-with-cocoapods"><strong>Initial Setup</strong></a>, tests are created by subclassing <strong>FBSnapshotTestCase </strong>instead of XCTest.</p><p>Then set recordMode = trueto allow reference image(s) to be generated when the test is ran.</p><p>Finally create a test that instantiates the view and call FBSnapshotVerifyView().</p><p>Here’s an example:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1e2b711d9368b2dbb8b7bcaa1c33ed31/href">https://medium.com/media/1e2b711d9368b2dbb8b7bcaa1c33ed31/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*7qviYbbp1WbIQWez1YaVOA.png" /><figcaption>The reference image created</figcaption></figure><p>Now that a reference image has been created, set recordMode = false. Now if no changes have been made to the view the test will pass!</p><p>With FBSnapshotVerifyView() there are several parameters that can be passed to offer more control. Such as the following:</p><p>FBSnapshotVerifyView(view, identitifer: &quot;simpleView&quot;, tolerance: 0.5)</p><h3>How does it work?</h3><p>Underneath the hood, it compares views by rendering them into two <strong>CGContextRefs</strong>. Then it looks at the memory of them using the C function memcmp() to make sure they are equal.</p><h3>Conclusion</h3><p>Since coming across this framework my workflow has <strong>simplified immensely</strong>. I work on a large application and having the ability to <strong>not compile</strong> and run the app every time I want to check out a UI changed has saved some <strong>significant time</strong>.</p><p>It’s a simple yet powerful tool that I would recommend people try out!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=509303283073" width="1" height="1" alt=""><hr><p><a href="https://medium.com/freelancer-engineering/ui-testing-in-a-snap-iossnapshottestcase-509303283073">UI testing in a snap — iOSSnapshotTestCase</a> was originally published in <a href="https://medium.com/freelancer-engineering">Freelancer Engineering &amp; Data Science</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[XcodeGen - A better way to manage Xcode Projects]]></title>
            <link>https://medium.com/freelancer-engineering/xcodegen-a-better-way-to-manage-xcode-projects-3359d2a31d86?source=rss-629bbdc69c38------2</link>
            <guid isPermaLink="false">https://medium.com/p/3359d2a31d86</guid>
            <category><![CDATA[xcodegen]]></category>
            <category><![CDATA[xcode]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[swift]]></category>
            <category><![CDATA[swift-programming]]></category>
            <dc:creator><![CDATA[Daniel Williamson]]></dc:creator>
            <pubDate>Tue, 20 Feb 2018 04:52:49 GMT</pubDate>
            <atom:updated>2018-07-08T23:05:50.662Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/566/1*OyLGiqpinG-hnaPreUL39g.png" /></figure><h4>The problem</h4><ul><li>.xcodeproj files suck</li><li>They aren’t human readable</li><li>When merge conflicts do occur this makes them pretty impossible to resolve</li></ul><h4>The Current “Solution”</h4><p>Adding this line to your .gitAttributes</p><pre>*.pbxproj merge=union</pre><p>This attribute tells git that whenever there is a merge conflict with any .pbxproj file then <strong>merge</strong> <strong>automatically</strong> and take <strong>both sides</strong>.</p><p>Nine times out of ten this will work fine. However when it dosen’t things go south real quickly.</p><p>Depending on the size of your project you can end up with hundreds of seemingly insolvable conflicts where blocks of code end up where they shouldn’t. If you have ever experienced this you know it can quickly become a <strong>nightmare</strong>.</p><h4>Welcome XcodeGen</h4><p>After searching for a solution I came across XcodeGen.</p><p><a href="https://github.com/yonaskolb/XcodeGen">GitHub - yonaskolb/XcodeGen: A Swift command line tool for generating your Xcode project</a></p><blockquote>XcodeGen is a command line tool that generates your Xcode project using your folder structure and a simple project spec.</blockquote><p>With XcodeGen you create <strong>Project Specs </strong>which can either be in <strong>JSON</strong> or <strong>YML</strong>. These specs contain all the information to generate a project. Targets, Schemes, Settings, Dependencies. You name it, it’s covered.</p><p>A basic application Spec can be declared in just a few lines:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/5f30ae1d3f27a35db49f3c1ebc27e872/href">https://medium.com/media/5f30ae1d3f27a35db49f3c1ebc27e872/href</a></iframe><p>After creating the Spec you simply run:</p><pre>xcodegen</pre><p>And the project is generated instantly!</p><p>The <a href="https://github.com/yonaskolb/XcodeGen/blob/master/Docs/ProjectSpec.md">ProjectSpec</a> is quite exhaustive and covers almost every edge case in regards to settings and configurations.</p><p>I would recommend any team to try out XcodeGen, as although the inital setup of creating the Specs by copying the existing settings from Xcode can seem tedius. The time and hassle saved in the future is more than worth it.</p><p>Thanks for reading!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3359d2a31d86" width="1" height="1" alt=""><hr><p><a href="https://medium.com/freelancer-engineering/xcodegen-a-better-way-to-manage-xcode-projects-3359d2a31d86">XcodeGen - A better way to manage Xcode Projects</a> was originally published in <a href="https://medium.com/freelancer-engineering">Freelancer Engineering &amp; Data Science</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>