WWDC Notes: Discover concurrency in SwiftUI

When performing slow work, you might dispatch off of the main queue. Updating an observable object off of the main queue could result in this updating colliding with a “tick” of the run loop. This means that SwiftUI receive an objectWillChange, and attempt to redraw UI before the underlying value Read more…

WWDC Notes: Meet AsyncSequence

Map, filter, reduce, dropFirst all work in async sequences: for try await someThing in async.dropFirst() { } For example. AsyncSequence suspends on each element and receives values asynchronously from the iterator. AsyncSequences either complete with success or stop when an error is thrown. Implementing an AsyncSequence follows all the rules Read more…

WWDC Notes: Meet async await in Swift

There are tons of async await compatible functions built-in into the SDK. Often with an async version and completion handler based function. Sync code blocks threads, async code doesn’t When writing async code with completion handlers you unblock threads but it’s easy to not call your completion handlers. For example Read more…