“Generic extensions”?

Currently in Swift the zip function is implemented similar to this: // The actual signature/implementation is different than this for performance // reasons, but the end functionality is the same…

Using dynamic member lookup to implement the builder pattern

SwiftUI’s syntax is unmistakable in regards to building views — instead of assigning properties to your view, you just apply a modifier that returns another view: Text("Hello, world!") .bold() .foregroundColor(.red)…

Recreating the iOS 12.2 Wallet table view

UPDATE: This feature is now built-in starting with iOS 13 via the insetGrouped table view style! The Wallet app was redesigned in iOS 12.2 with a fresher, more rounded…

Implementing Promise.some/any in Swift PromiseKit

PromiseKit is a popular library for Swift programs that helps make asynchronous code more readable. Essentially it works like this: firstly { makeNetworkRequest() }.then { downloadUserProfile() }.then { profile in…

What does _: (nameless argument) mean in Swift?

If you’ve dived deep enough in Swift functions you have probably come across one looking like this: func myFunc(_: Type) After looking at it for a moment, you may…
Back to top ↑