Welcome to another week of Swift Developments! This weeks issue is a bit of a special issue as it marks a full year of publishing this weekly roundup – a bit of a personal achievement for me!
Anyway, I just wanted to take a moment before we get to this weeks links to say thanks again for subscribing and thanks again for reading every week. I also wanted to say thanks if you are one of the people who have provided input and encouragement over the last year – it’s definitely appreciated.
Ok, let’s dive in take a look at this weeks links!
P.S. If you’re at @iOSDevUK next week come I’ll be around and about so come and say ‘Hi’!
Whichever way you look at it, the app store is extremely competitive. The days are long gone when a flashlight app could provide enough income to support a viable ongoing business. This week saw another casualty of this cutthroat world with @brentsimmons, @gruber and @dwiskus announcing the closure of their notes app Vesper. In and of itself, apps shutting down are not a particular new phenomenon but it’s another example that highlights some of the struggles developers are facing in supporting themselves via the app store and also shows that smarts and solid engineering alone are not enough to guarantee long-term app-store success. Reflecting back, there seem to be a number of lessons learnt. Definitely food for thought.
App analytics are a useful way of extracting additional information about how users are using our app in the wild but with the multitude of different measurements and metrics at your disposal which metrics should you pay attention to and which should you ignore? In this article, @yaeltolub lays out 12 most important performance indicators for predicting app success.
Sponsor Swift Developments
There’s a lot that goes into the design of an app. The views, color scheme, navigation and how data is organised to name just a few. However, one component that may not immediately spring to mind is the apps textual content – the words we use on the labels and buttons of our interface and the feedback we provide to our users. Microcopy is the art of writing micro or short form copy for your buttons, labels and text fields and in this article, @lucie_delacy and @crocstar provide some great tips that you can apply in your own apps.
I wrote an article about Swift Error Handling a few weeks ago and briefly touched on how Result types were a common solution for dealing with errors across asynchronous boundaries. In this article however, @cocoawithlove takes things a step further, specifically examining why we need Result Types, the capabilities they provide and the reasons why they have been rejected from Swift’s Standard Library.
As you’ve no doubt seen, the Swift programming language promotes the use of value types much more than Objective-C did. In this article, a draft version of an updated section from his book Advanced Swift, @chriseidhof looks at looks at structs and mutation as well as some of the advantages that using structs brings over classes.
I linked to @olebegemann‘s series on the new measurements and types in the the Foundation Framework a few weeks ago, but this week he’s released a bonus post taking the ideas explored in the series and re-engineering them from a pure Swift perspective using generic (phantom) types. It’s interesting read.
With many of us using either Carthage or Cocoapods to integrate third-party libraries into our own apps, writing unit tests and mocking all these dependencies can seem a little tricky at first. However by using Swift protocols we have the ability to extend any type, including types from other frameworks. This in turn provides us with all the tools we need to mock almost any other class on which our app depends. In this article, @marinbenc shows us how.
Consistency. It’s helps reduce the learning curve of your apps code base and helps ensure a clean consistent style across all your Swift code. Swift Format by @nicklockwood is a command line tool and code library to help with this letting you automatically apply formatting rules your Swift code and removing the need to manually enforce these rules at code review.
Announced at WWDC this year, Swift playground books have the potential to add new ways for people to learn how to code as well as providing a convenient way for more seasoned developers to learn new frameworks and techniques. However, building these Playground Books isn’t as easy as you might think as they require a very specific nested folder structure and associated manifest file for them to work. @ashfurrow decided to tackle this problem and this week sees the release of playgroundbook a tool to help generate Playground books from regular playgrounds. Worth a look if you’re putting together playground books of your own.
Swift Messages from SwiftKick Mobile, is a Swift library for displaying brief messages and notifications in the form of a status bar across the top or bottom of the screen. The library supports full customisation of the displayed view along with a number of other options including dimming the background when the message is displayed and auto-hiding after a configurable period of time.
Compared to other languages testing doesn’t seem to have been embraced in the iOS and Swift community as much as it has in other languages such as Ruby or Java. However, despite this talks evocative title, @rjchatfield shows us that (spoiler) testing is NOT actually dead by looking at the many different types of testing we can employ during app development. His talk includes details on how often we should write tests, how difficult they are to write and how hard they are they to maintain in the long-term. It’s a great introduction to the subject if you or your team are yet to get started.
“Swift developers tend to favour a declarative programming style, but UIKit requires the opposite. UIKit mostly works on delegates and callback blocks that provide data to the framework and influence what is rendered on the screen. Forcing our Swift code into this architecture often results in code that is difficult to understand and maintain. What if we could turn this inside out?”.
In this talk from AltConf2016, @benjaminencz investigates.
If you’re still a little hazy about the difference between static and dynamic types, this article from @garybernhardt is probably what you’re looking for. It’s a great look at the difference between the two kinds of type system and incorporates examples from a range of different languages whilst simultaneously providing insight into the benefits and drawbacks of each approach.