Quantcast
Channel: Augmented Code
Browsing all 24 articles
Browse latest View live

Wrapping async-await with a completion handler in Swift

It is not often when we need to wrap an async function with a completion handler. Typically, the reverse is what happens. This need can happen in codebases where the public interface can’t change just...

View Article


How to keep Date’s microseconds precision in Swift

DateFormatter is used for converting string representation of date and time to a Date type and visa-versa. Something to be aware of is that the conversion loses microseconds precision. This is...

View Article

Sorting arrays in Swift: multi-criteria

Swift’s foundation library provides a sorted(by:) function for sorting arrays. The areInIncreasingOrder closure needs to return true if the closure’s arguments are increasing, false otherwise. How to...

View Article

AnyView is everywhere in Xcode 16

Loved to see this entry in Xcode 16’s release notes: Xcode 16 brings a new execution engine for Previews that supports a larger range of projects and configurations. Now with shared build products...

View Article
Browsing all 24 articles
Browse latest View live