Learn more about WWDC21 Notes

WWDC Notes: Swift concurrency: Behind the scenes

Published on: June 10, 2021

Meet async / await, explore structured concurrency, protect mutable state with actors should be watched first. Threading model Compares GCD to Swift. It’s not built on top of GCD. It’s a whole new thread pool. GCD is very eager to bring up threads whenever we kick off work on queues. When a queue blocks its […]

Read post

WWDC Notes: Bring Core Data concurrency to Swift and SwiftUI

Published on: June 10, 2021

Persistence everywhere Core Data takes care of many complexities to persist data. It converts in-memory graph to persisted data and takes care of all kinds of complex tasks like memory management. Core Data works on all platforms, and it’s great in Swift. Apple’s been working to make Core Data better with Swift over the years. […]

Read post

WWDC Notes: Discover concurrency in SwiftUI

Published on: June 9, 2021

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 is updated. This will lead […]

Read post

WWDC Notes: Meet AsyncSequence

Published on: June 9, 2021

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 that a normal sequence follows. […]

Read post

WWDC Notes: What’s new in SwiftUI

Published on: June 9, 2021

A good way to get started with SwiftUI is to use it for new features. SwiftUI can be mixed in with UIKit and AppKit code. It also allows you to expand into new platforms, like macOS, with little to no work. Essentially, try to do new work with SwiftUI whenever you can. Better lists SwiftUI […]

Read post

WWDC Notes: Protect mutable state with Swift actors

Updated on: September 13, 2022

Data races make concurrency hard. They occur when two threads access the same data and at least one of them is a write. It’s trivial to write a data race, but it’s really hard to debug. Data races aren’t always clear, aren’t always reproducible, and might not always manifest in the same way. Shared mutable […]

Read post

WWDC Notes: Explore structured concurrency in Swift

Published on: June 8, 2021

Structured programming uses a static scope. This makes it very easy to reason about code and its flow. Essentially making it trivial to understand what your code does by reading it from top to bottom. Asynchronous and concurrent code do not follow this structured way of programming; it can’t be read from top to bottom. […]

Read post

WWDC Notes: Meet async await in Swift

Published on: June 8, 2021

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 when you use a guard […]

Read post

Thoughts on Combine in an async/await world

Published on: June 8, 2021

When Apple announced their own Functional Reactive Programming framework at WWDC 2019 I was super excited. Finally, a simplified, easy to use framework that we could use to dip our toes in FRP. What made it even better is that SwiftUI makes heavy use of Combine, which means that Apple had to buy in to […]

Read post

Expand your learning with my books

Practical Combine header image

Learn everything you need to know about Combine and how you can use it in your projects with Practical Combine. It contains:

  • Thirteen chapters worth of content.
  • Playgrounds and sample projects that use the code shown in the chapters.
  • Free updates for future iOS versions.

The book is available as a digital download for just $39.99!

Learn more