The power of extensions in Swift
An overview of the sort of patterns and techniques that Swift’s extensions enable us to adopt, and how extensions can turn out to be one of the most powerful features that the language has to offer.
Articles, podcasts and news about Swift development, by John Sundell.
An overview of the sort of patterns and techniques that Swift’s extensions enable us to adopt, and how extensions can turn out to be one of the most powerful features that the language has to offer.
This week, let’s take a look at how subscripting works in Swift, and a few different ways to incorporate it into the way we design APIs — including some brand new capabilities that are being added in Swift 5.1.
The UserDefaults API can at first glance appear to be somewhat limited. However, it turns out that the power of UserDefaults extends far beyond simply storing and loading basic value types. This week, let’s take a look at what some of that power comes from, and how we can appropriately make use of it in the apps that we build.
When using syntactic sugar, what we ideally want is to be able to strike a nice balance between low verbosity and clarity, and this week, let’s take a look at a few different ways that type aliases can enable us to do just that.
Swift keeps gaining more and more features that are more dynamic in nature, while still retaining its focus on type safe code. This week, let’s take a look at how key paths in Swift work, and some of the cool and powerful things they can let us do.
Although Set is one of those core data structures that you see in almost every programming language, it sometimes get a bit overlooked. This week, let's take a look at a few different examples of when using a set can lead to more predictable performance and simpler code, as well as some of Swift's Set type's lesser known - yet very powerful - features.
While switch statements are hardly something that was invented as part of Swift, they are made a lot more powerful when combined with Swift's type system. This week - let's go further beyond switching on single enum values and take a look at more of the powerful capabilities that switch statements offer in Swift.