Swift Developments is a hand-curated newsletter containing a weekly selection of the best links, videos, tools and tutorials for people interested in designing and developing their own apps using Swift.
Welcome Issue 163 of the Swift Developments Newsletter! I just wanted to mention something before we dive in this week. Since changing email service provider a couple weeks ago a some of you have got in touch to say that my Swift Developments emails are now appearing in the spam folder rather than in your inbox. Not ideal! Now, if this sounds familiar (and you haven’t done this already) one good way to avoid this is to add my email address to your address book. This way, your email provider won’t think my Swift Developments emails are spam and hopefully future issues will be delivered straight to your inbox! Ok, so with that out of the way, let’s get on with this weeks links.
This week, Apple have published their Best of 2018, a curated list of some of the most innovative and well-designed apps and games and the designers behind them. Although the list is interesting, @arielmichaeli has made the list even more meaningful, by digging into the actual download numbers that underpin these apps. It’s an interesting read.
If you’re a game developer you’ll want to read this series. In this three part series (Part 1, Part 2, Part 3) @esanueugen takes a look at the concept of Gamification – what it is, how it works and how you can put it into practice by building it into your own creations.
Analytics are a great way of monitoring user behaviour and when it comes to implementing this for yourself, there’s a wide range of frameworks and servcies to choose from including Apple’s own analytics, Firebase Analytics, Mixpanel, Localytics and more. Whichever framework you opt for, it’s always a good idea to build in a level of abstraction between your code and the actual framework you choose to help with future extensibility and to make it easier to migrate to a different service in future. In this article, @lordcodes shows you how to do just that, walking through the steps to build an abstraction layer to help separate your code from API specifics whilst simultaneously leveraging all the goodness of the Swift language.
With the Apple editorial team spending column-inches in it’s Best of 2018 article to highlight the undo experience in Procreate Pocket, @daringfireball has written an interesting piece – Proof That iOS Still Hasn’t Gotten Undo Right – that speculates on whether this is actually an indictment of the state of the iOS’s user interface standards. It’s worth a read – as is this newly published article from the @Procreate team themselves in which they release the code for their well received undo gesture.
Ever wanted to create your own screen saver in Swift? It may not be as easy as you may think – especially in Swift – due to the need to package the Swift standard libraries into the application package. Whilst Swift 5 and ABI stability will likley help, in the mean time it hasn’t stopped some great community-driven screensavers such as Aerial and Brooklyn (my current screen saver of choice) being produced. So if you’re after a weekend project to build your own screensaver you’ll want to read this article from @pedrommcarrasco which will help you navigate these tricky waters.
The UIView class is central to the entire UIKit framework and as such has a wide range of responsibilities covering everything from layout to accessibility. With such a breadth of capabilities, in such a wide range of areas there are inevitably features that you may either, not be aware of, or had simply forgotten about. In this article @iosdevrecipes makes an attempt to redress this situation, with a look at a couple of lesser-known features of the UIView class – the
Although I do my best to hunt for best links for you each week, I haven’t got eyes and ears everywhere and in all honesty this article hadn’t come across my radar until @mikemikina suggested it. The thing is, I’m really glad he did. It’s a great little server-side Swift project that uses Vapor and Swift to wrap the popular C-based ImageMagick framework in order to add watermarks to Vapor-served photos. Apart from being a great weekend project, it’s also a good reminder for me to mention that I’m *always* open to suggestions for links for future issues – just get in touch via email, the website or on Twitter! ?
When it comes to distributing your latest creation your have a wide ranges of choices. For iOS and macOS code we have package managers such as Carthage or Cocoapods, for Swift Packages we can use the Swift Package Manager. For command line tools though we have an additional option – HomeBrew. @mattt guides you through the process.
Snapshot testing has become increasingly popular within the iOS community, mainly thanks to the efforst of the iOSSnapshotTestCase library (formerly known as FBSnapshotTestCase). This week saw a new library entering the fray, with the guys at @pointfreeco releasing SnapshotTesting 1.0 – a modern, composable snapshot testing library written entirely in Swift.
When writing unit tests it’s not unusual to use various mocking techniques to isolate your code under test and to exercise various hard-to-reach paths through your code. However, as @johnsundell points out in this article, there are cases where avoiding mocks can be beneficial. Confused? John takes a look at how to write mock-free unit tests in Swift.
Best iOS hacks from Twitter: October & November Edition
@LisaDziuba returns with her roundup of the October and November’s best iOS development tips around the Twitterverse. As ever, there are some great tips covering everything from Interface Builder, Auto Layout and Xcode shortcuts to iPad Pro, debugging and obscure Apple trivia.