Sign in

Point-Free

@pointfree.co
1.3K followers 221 following 790 posts

A video series exploring advanced topics in the Swift programming language, hosted by @mbrandonw.bsky.social and @stephencelis.com. Save 30% off today! www.pointfree.co/discounts/black-fr…

PostsRepliesMedia
Point-Free @pointfree.co · 30/09/2026
We tried using two modern Swift concurrency tools to allow us to embrace non-sendability: • nonisolated(nonsending) • Task.immediate They got us close to our goals, but sadly there were still data races. Watch this week's episode to understand why: www.pointfree.co/episodes/ep3...
030
Point-Free @pointfree.co · 29/09/2026
Our deep dive into Swift isolation from a few months back may have been a bit abstract for people, so we are bringing things down to earth by designing real world code with isolation in mind from the beginning: www.pointfree.co/collections/...
031
Point-Free @pointfree.co · 28/09/2026
Our code is at an impasse: we want to embrace non-sendability, but async work seems to force us into Sendable. We’ll revisit our approach to this problem from ComposableArchitecture 1.0, see why it's not ideal, and search for a better way. www.pointfree.co/episodes/ep3...
011
Point-Free @pointfree.co · 23/09/2026
We’ve started a new series: Designing for Isolation Learn how designing for isolation from the beginning lets you embrace non-Sendable types, maintain thread safety, and keep asynchrony from infecting every corner of your codebase. Follow along here: www.pointfree.co/collections/...
173
Point-Free @pointfree.co · 21/09/2026
It’s time to put what we’ve learned about isolation into practice. We’re building the reimagined Composable Architecture 'Store' from scratch and exploring the benefits of strictly controlling isolation through every layer of the library. www.pointfree.co/episodes/ep3...
022
Point-Free @pointfree.co · 10/09/2026
For the past 10 weeks we have analyzed many of the new SwiftUI and SwiftData features announced at WWDC26. We uncovered a lot of things that haven't gotten widespread attention in the community, and now the whole series is free! 👉 www.pointfree.co/blog/posts/2...
020
Point-Free @pointfree.co · 03/09/2026
We wrapped up our Swift isolation series a few weeks back, but our members have had some nice things to share since then... 😊 www.pointfree.co/collections/...
120
Point-Free @pointfree.co · 02/09/2026
Compare to SwiftUI’s LazyState (wrapped in a macro by us), where we get to drop all the Optional dancing, potentially buggy “onAppear” logic, and generally write things as succinctly as possible:
The following code snippet:

struct TripMap: View {
  @Binding var selection: Trip?
  @LazyState private var mapController: MapCameraController
  @State private var mapSelection: MapSelection<Trip>?

  init(
    selection: Binding<Trip?>,
    modelContext: ModelContext
  ) {
    self._selection = selection
    self._mapController = LazyState {
      MapCameraController(modelContext: modelContext)
    }
  }

  var body: some View {
    Map(position: $mapController.cameraPosition, selection: $mapSelection) {
      ForEach(mapController.trips) { (trip: Trip) in
        if let location = trip.location {
          Marker(trip.name, coordinate: location.coordinate)
            .tint(trip.color)
            .tag(MapSelection(trip))
        }
      }
    }
    .onChange(of: mapSelection) { _, newValue in
      if case .some(let mapSel) = newValue {
        selection = mapController.trips.first { MapSelection($0) == mapSel }
      }
    }
  }
}
143
Point-Free @pointfree.co · 02/09/2026
The pattern Apple has established for influencing a view’s @‌State from a parent: 1. Make the state private and Optional 2. Populate the state in onAppear This means extra boilerplate, imprecise domains, optional coalescing and chaining dances, and potential lifecycle bugs!
Code from Apple's SampleTrips WWDC26 project (with problem areas highlighted):

struct TripMap: View {
  @Environment(\.modelContext) private var modelContext
  @Binding var selection: Trip?
  @State private var mapController: MapCameraController?
  @State private var mapSelection: MapSelection<Trip>?

  init(selection: Binding<Trip?>) {
    self._selection = selection
  }

  private var cameraPosition: Binding<MapCameraPosition> {
    Binding(
      get: { mapController?.cameraPosition ?? .automatic },
      set: { mapController?.cameraPosition = $0 }
    )
  }

  var body: some View {
    Map(position: cameraPosition, selection: $mapSelection) {
      ForEach(mapController?.trips ?? []) { (trip: Trip) in
        if let location = trip.location {
          Marker(trip.name, coordinate: location.coordinate)
            .tint(trip.color)
            .tag(MapSelection(trip))
        }
      }
    }
    .onAppear {
      self.mapController = MapCameraController(modelContext: modelContext)
110
Point-Free @pointfree.co · 01/09/2026
Xcode 27 beta 6 quietly changed how SwiftData's sectioning APIs work. Did you notice? The @Query macro must now explicitly use the SectionedResults type, which means it is no longer possible to dynamically add/remove sectioning from a view.
The following code diff:

 @Query(sort: \Item.name, sectionBy: \Item.category)
-var items
+var items: SectionedResults<Item, String>

-ForEach(_items.sections) { section in
+ForEach(items) { section in
   Section(section.title) {
     ForEach(section) { item in … }
   }
 }
011
Point-Free @pointfree.co · 31/08/2026
We explore the problems not solved by the new @‌State macro and explain why we think they should be solved. To close this gap we introduce a new @‌LazyState macro, which allows you to delay initialization of your state, all without introducing any new API! 👉 www.pointfree.co/episodes/ep3...
020
Point-Free @pointfree.co · 27/08/2026
You've probably heard by now that SwiftUI has a fancy @‌State macro that lazily creates state, fixing a longstanding issue in the framework. But what you may not know is that the laziness only kicks in for **private** state. Get all the details here: www.pointfree.co/episodes/ep3...
184
Point-Free @pointfree.co · 26/08/2026
The new @‌State macro uses a type called LazyState under the hood, and this type has secretly existed in SwiftUI for years! We lift the veil on this type in this week's episode to see how Apple was able to back port @‌State to iOS 17: www.pointfree.co/episodes/ep3...
151
Point-Free @pointfree.co · 25/08/2026
The new @‌State macro fixes a long-standing bug in SwiftUI, that of objects being needlessly allocated. But have you looked at the expanded macro code yet? Looks like gobbledygook! We show that all of this code is essentially just 3 lines of code: 👉 www.pointfree.co/episodes/ep3...
031
Point-Free @pointfree.co · 24/08/2026
WWDC26 brought the new @‌State macro to succeed the property wrapper, but what’s different about the macro, and how does it work? We’ll pick apart the cryptic macro expansions to see something quite simple at its core. www.pointfree.co/episodes/ep3...
010
Point-Free @pointfree.co · 20/08/2026
It may seem too good to be true, but you can indeed exhaustively test all of the data held in reference types (and even computed properties!). What is do it from scratch in this week’s episode: www.pointfree.co/episodes/ep3...
000
Point-Free @pointfree.co · 20/08/2026
We built a geofence for our Trips app that turns red if it doesn’t contain the trip. Impressive stuff, but complex enough to deserve some tests! We show how to exhaustively test it like a value type, so a missed assertion is a test failure with a nice message. 🤯
100
Point-Free @pointfree.co · 19/08/2026
Many took SwiftData queries being limited to SwiftUI views as proof that everything belonged in views. But appleOS 27 now allows queries to live outside views, which is something SQLiteData has supported since day one and back-deploys to iOS 16! www.pointfree.co/episodes/ep3...
010
Point-Free @pointfree.co · 19/08/2026
We always felt SwiftData queries were needlessly constrained by having to live directly in views. That’s why SQLiteData was built from day one to work equally well in SwiftUI views, @‌Observable models, and even UIKit view controllers. www.pointfree.co/episodes/ep3...
010
Point-Free @pointfree.co · 18/08/2026
This week we build a geofence editor using SQLiteData’s type-safe JSON APIs, and we show how everything is 100%, exhaustively testable. www.pointfree.co/episodes/ep3...
A screen shot of Xcode showing a geofence editor preview alongside code that updates a dragged vertex using type-safe SQLite JSON APIs.
011
Point-Free @pointfree.co · 18/08/2026
Announcing: Episode Search! This was probably our most requested feature. Have you ever wanted to revisit a topic but forgot which episode discussed it? You can now search our entire catalog of video transcripts, from speech to code. Try it out today: www.pointfree.co/blog/posts/2...
020
Point-Free @pointfree.co · 17/08/2026
This year SwiftData introduced a brand new way to observe changes outside of the view where @‌Query cannot be used. What’s SQLiteData have to say about that? To explore, we’ll build a moderately complex geofence map editor and get full test coverage of the feature. www.pointfree.co/episodes/ep3...
031
Point-Free @pointfree.co · 13/08/2026
You asked for it; you got it! Point-Free now supports passwordless, email-based login. No GitHub account? No problem! www.pointfree.co/blog/posts/2...
A screenshot of our sign up form.
020
Point-Free @pointfree.co · 13/08/2026
SQL tables tend to get wide as you add more and more columns, but your Swift data types don’t have to! SQLiteData allows you to group related columns into tidy Swift types while also flattening all fields into individual columns in SQL.
111
Point-Free @pointfree.co · 12/08/2026
SQLiteData has always let you write SQL in a schema-safe, injection-safe manner, so it was easy to exercise APIs it didn’t provide Swift tools for, like JSON. But did you know these days SQLiteData does come with JSON tools, including the powerful “jsonEach” function?
A comparison between using #sql for a schema-safe JSON query, or a fully type-safe JSON query using the “jsonEach” table-valued function.
100
Point-Free @pointfree.co · 11/08/2026
The @‌Table macro in SQLiteData can diagnose when you are trying to hold Codable data in a table, and will ask you if you want to store that as JSON or JSONB. It's a small touch that greatly improves the experience of using our library. Learn more: www.pointfree.co/episodes/ep3...
000
Point-Free @pointfree.co · 11/08/2026
An invigorating discussion on the Swift forums has brought to light that the dangers of conforming reference types to Hashable by hashing their data rather than their identity are not widely understood. We devoted four episodes to this topic! forums.swift.org/t/pitch-defa...
030
Point-Free @pointfree.co · 10/08/2026
JSONB is an efficient binary representation of JSON. This week we add a “geofence” JSONB column to the Trip model type, and construct powerful queries through it, like the ability to filter trips by geofences that straddle the equator. www.pointfree.co/episodes/ep3...
000
Point-Free @pointfree.co · 07/08/2026
What if wanted to sort a list of trips by their proximity to our current location? Sounds complicated, but we can compute the great-circle distance between coordinates directly in SQL and it's incredible to see! www.pointfree.co/episodes/ep3...
010
Point-Free @pointfree.co · 07/08/2026
While this week we explore the advanced JSON capabilities of SQLite, we have made last week's episode free! Explore what SQLiteData has to say about sectioning results and how it compares to SwiftData: 👉 www.pointfree.co/collections/...
021
Point-Free @pointfree.co · 05/08/2026
SwiftData supports Codable fields, but be careful not to use them for filtering or sorting. Code that compiles just fine will warn and even crash at runtime! SQLiteData on the other hand gives you direct access to SQLite’s powerful JSON APIs for filtering, sorting, and more!
An excerpt from this week’s episode showing a SwiftData query that fails with a warning at runtime alongside the equivalent SQLiteData query that just works.
100
Point-Free @pointfree.co · 04/08/2026
Storing complex data as JSON in a table doesn't mean it should be un-queryable. SQLite has amazing support for JSON. This week we show how to expose the schema of Codable types to our query builder in order to write type-safe and schema-safe queries! 👉 www.pointfree.co/episodes/ep3...
011
Point-Free @pointfree.co · 04/08/2026
Get all the details here: www.pointfree.co/collections/... We define what isolation is, how the compiler can statically enforce it, how you can expand and contract domains of isolation, and give real world examples of what isolation buys you.
010
Point-Free @pointfree.co · 03/08/2026
We explore how encoding data to JSON does not hinder our ability to query it from SQLite’s powerful tools. We can filter, sort, and even section results by location data stored as JSON, and all with type safe and schema safe guarantees at compile time. www.pointfree.co/episodes/ep3...
000
Point-Free @pointfree.co · 31/07/2026
The sky’s the limit when it comes to querying and displaying data using SQLiteData. Here we show how @‌Fetch can be used to query data into any shape you can imagine, including hierarchical trees.
An example of SQLiteData a recursive query grouping employees into boss–reports buckets to display in a list tree.
100
Point-Free @pointfree.co · 29/07/2026
SwiftData’s new “sectionBy:” API is super cool, but did you know SQLiteData supported sectioning from day one? You have always had the ability to @‌Fetch your data into whatever shape you want. Here we use swift-collections’ OrderedDictionary to group results:
Screen shot of a SQLiteData FetchKeyRequest that groups results into sections using an OrderedDictionary.
000
Point-Free @pointfree.co · 29/07/2026
Our query builder has some super powers built in. Look how short and succinct it can be when querying for all/business/personal trips, sorted by trip end date, start date or name! All of it fits in only a few lines of code: www.pointfree.co/episodes/ep3...
010
Point-Free @pointfree.co · 28/07/2026
This week we showed off just how short and succinct our query builder can be. Need a single query that filters all/business/personal trips and sorts by trip end date, start date or name? It all fits in just a few lines of code: www.pointfree.co/episodes/ep3...
000
Point-Free @pointfree.co · 28/07/2026
This week we got to show off how short and succinct our query builder can be. Want a single query that can filter all/business/personal trips and sort by trip end date, start date or name? It all fits in just a few lines of code: www.pointfree.co/episodes/ep3...
010
Point-Free @pointfree.co · 27/07/2026
SwiftData’s new sectionBy API groups results of @‌Query into sections, a much needed addition! SQLiteData supported sectioning from day one, and more. We’ll show just how far these tools can go before introducing an ergonomic API to match SwiftData’s. www.pointfree.co/episodes/ep3...
041
Point-Free @pointfree.co · 24/07/2026
Take vanilla Swift data types, sprinkle in a few annotations, and you can instantly persist it to SQLite.
A SQLiteData definition of an enum that can be coded to SQLite.
100
Point-Free @pointfree.co · 24/07/2026
What’s better than SwiftData class inheritance? SQLiteData enums! Model your data using simple value types that can exhaustively and concisely describe valid state at compile time.
An example of working with SwiftData class inheritance from WWDC26 sample code.An equivalent example of a SQLiteData table: a single data type with an enum to group differences instead of subclassing.
120
Point-Free @pointfree.co · 23/07/2026
SQLiteData’s @‌Table macro employs some pretty advanced tricks to surface the best possible failure diagnostics and fix-its. It’s very common for macro errors to be buried in macro-generated code, but it doesn’t have to be this way! See it in action: www.pointfree.co/episodes/ep3...
A still from this week’s video (linked below) showing a failure diagnostic with fix-its for a column not representable as a column in SQL.
010
Point-Free @pointfree.co · 20/07/2026
We compare SwiftData’s new features with SQLiteData, starting with a domain modeling exercise. We will rewrite the Trips @‌Model classes into simple @‌Table structs, and we will explore how the Draft type can power a single form for both creating and updating trips: www.pointfree.co/episodes/ep3...
000
Point-Free @pointfree.co · 16/07/2026
We just made another one of our WWDC26 videos free! Learn about what’s new in UIKit and how the UIKitNavigation library extends the framework with bindings and state-driven navigation to help you to model your domains concisely. www.pointfree.co/episodes/ep3...
A still from the video showing a UIViewController with a state-driven alert presentation.
021
Point-Free @pointfree.co · 13/07/2026
What’s new this year in SwiftData? We dive deep into each topic to figure out what exactly to figure out what exactly is new, what are the gotchas, and prepare for a lesson on how to best model your domains concisely. www.pointfree.co/episodes/ep3...
011
Point-Free @pointfree.co · 07/07/2026
AppleOS 27 brings a few new tools to UIKit, but our UIKitNavigation library has all of this and more: ✅ Modern alert API ✅ State-driven navigation ✅ Concisely modeled domains ✅ Animations and transactions ✅ Back-ported to iOS 13 Check it out: www.pointfree.co/collections/...
020
Point-Free @pointfree.co · 06/07/2026
In celebration of #WWDC26, we are making our video on SwiftUI’s new alert API free! Get a history lesson on alerts in SwiftUI over the years, learn about efficient domain modeling, and how a lightweight package can take things even further. www.pointfree.co/episodes/ep3...
A screen shot of the video.
031
Point-Free @pointfree.co · 06/07/2026
WWDC brought more adoption of the Observation framework to UIKit, but more can be done. We will employ our UIKitNavigation library to show how we can add SwiftUI-like navigation and controls to a UIKit feature, including animations and transactions. 👉 www.pointfree.co/episodes/ep3...
000
Point-Free @pointfree.co · 02/07/2026
Our SwiftNavigation library comes with alert helpers that address all of the trade-offs that come with SwiftUI’s built-in helpers (and a whole lot more!). Customize and drive your app’s alerts in the most concise and correct way possible.
A code sample showing SwiftUINavigation’s alert helper.
160