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.
This week saw Apple announcing some modifications to Apple’s App Store Search Ad offerings that not only streamline the Search Ad process but also provide a new way for developers to pay for app promotion – namely the ability to pay by install. Don’t worry, the old way of promoting ads still exists (having be re-branded ‘Search Ads Advanced’) but this does give developers another if your not particular au fait with app promotion. If you’re interested, check out Apple’s Search Ad Site for more details.
Although Swift’s new Codable protocol has made encoding Swift types to and from external representations such as JSON much easier, you may have noticed some unexpected results when encoding Swift Dictionaries where the dictionaries are sometimes encoded as Arrays rather than the key/value pairs you might expect. @olebegemann digs into the Swift code base to find out why.
With Swift supporting both value and reference types, many developers, especially those new to the language, commonly fall into the mindset of value types being generally ‘good’ and reference types being generally ‘bad’. This is not always the case though and if you’re struggling to decide on which type should be used when, @khawerkhaliq has written a great introduction on how and when to use value and reference types, their semantic differences, the advantages of using value types in Swift along with a bunch of tips on how to use value and reference types within your own Swift code. It’s a good read.
If you didn’t catch it, last week, @johnsundell published an interesting post on how to implement and collect analytics within your app. John’s approach was enum-based but since then, there have been a number of responses from around the community exploring different approaches to solving the same problem. @chriseidhof has written up a good summary but it’s a good reminder that there often isn’t one signal ‘best’ way to solve a problem and it often comes down to evaluating the advantages and disadvantages of a number of different approaches and identifying which option is best for you. Great to see these conversations happening in public though and also a great way to learn.
Protocols with associated types are one of the more tricky aspects of working with the Swift language and you can often end up in trouble with the compiler if you don’t get things quite right. If you’re still struggling to get your head around Swift protocols with associate types, @terhechte has written a great article on some of the potential workarounds you have at your displosal when things just aren’t going your way.
@gregheo returns with another interesting article on the innards of the Swift langauge. This time, Greg’s looking at some of the recent changes in Swift 4 that control how your Swift code is seen by the Objective-C runtime when working in mixed-language code bases.
Singletons are, for the most part, viewed as anti-patterns by much of the iOS development community but why is this? @bohdan_orlov looks at some of the issues that singletons can cause and explores whether whether there is a way we can still used singletons whilst also keeping our code testable.
With apps, and the navigation flows they contain, becoming increasingly complex, @onmyway133 walks you through a different approach to managing navigation flows within your app using Compass and the idea of centeral URL routing.
Core Data continues to remain a popular choice for many iOS developers but as apps grow, gain new features sees other less popular features removed, developers are commonly faced with a need to not only preserve their user’s data but also to do so whilst also mutating the underlying Core Data model of their apps. For Core Data, this means tackling Core Data Migrations and in this article, @wibosco provides four step-by-step examples to show you how.
With the growing focus user experience and understanding how people use their devices, the ability to access a users data whilst maintaining user privacy is a critical challenge faced by Apple and the larger tech community. Apple have tackled this problem through the use of ‘differential privacy’ – a mathematical approach that aims to maximise the accuracy of queries from a statistical database whilst minimizing the chances of being able to identify any individual records within that dataset a topic they have chosen to expanded on in their most recent Machine Learning blog post. It’s a fascinating read.
In a suprise release this week, Apple have published a new python-based tool called Turi Create. The new toolkit simplifies the development of custom machine learning models for common scenarios such as recommendation systems, image classification, image similarity, object detection, activity classification and text classification. It also contains a number of machine learning models organized into algorithm-based toolkits such as Classifiers, Regression, Graph Analytics, Clustering, Nearest Neighbor and Topic models. It’s great to see Apple trying to make it easier and easier for developers to include machine learning models within their apps.