Marin Todorov joins John to talk about bridging the gap between UIKit, Combine and SwiftUI, how to design intuitive and robust APIs, and how the developer community can augment Apple’s SDKs through open source.
Let’s take a look at how caching can be an incredibly powerful tool in various situations, how to build an efficient and elegant caching API in Swift, and how strategically caching various values and objects can have a big impact on the overall performance of an app.
This week, let’s take a look at convenient, but sometimes divisive language feature — computed properties — and how they can let us build really elegant convenience APIs, how to avoid accidentally hiding performance problems when deploying them, and a few different strategies for picking between a computed property and a method.
Deploying generics in a more gentle fashion — to make a code base simpler, not more complicated.
Even though most of our classes, structs, and other types might have initially been created to solve a very specific problem — over time, we quite often find ourselves wanting to use a highly similar version of that same type or logic, but for something entirely different. This week, let’s take a look at a technique for making that happen — that involves making certain types increasingly configurable.
Michael Ilseman, developer on the Swift team at Apple, joins John to go on a deep dive into the String type, its implementation, and its related APIs. Topics range from the way Swift’s String API is designed, to its underlying complexities, and practical performance tips.
Everyone is an API designer. While it’s easy to think of APIs as something that’s only relevant for SDKs or frameworks, it turns out that all app developers design APIs almost every single day. This week, let’s take a look at a number of tips and techniques that can be good to keep in mind when designing various APIs in Swift.
A DSL, short for Domain Specific Language, can be explained as a special kind of API that focuses on providing a simple syntax that's tailored to working within a specific domain. Swift's type inference and overloading capabilities also make it a really great language to build DSLs in - and this week, let's do just that.
How API design isn’t only something to consider when building frameworks and SDKs, but how it also can be a fantastic tool to improve the architecture of apps.
Swift’s @autoclosure attribute enables us to define an argument that automatically gets wrapped in a closure. It’s primarily used to defer execution of a (potentially expensive) expression to when it’s actually needed, rather than doing it directly when the argument is passed.
I’d like to share a technique that I’ve come to find quite useful when using Swift’s do, try, catch error handling model — to limit the amount of errors that can be thrown from a given API call.