Skip to content

2.1.4

Latest

Choose a tag to compare

@NikSativa NikSativa released this 26 Jul 08:58

Fix Swift 6.0 and 6.1 build failures caused by main-actor isolation crossings.

  • SceneSize: mutating the @State size from onPreferenceChange failed on Swift 6.0 across every Apple platform (main actor-isolated property 'size' can not be mutated from a Sendable closure). The mutation now hops through MainActor.assumeIsolated.
  • WindowSize: the AppKit NSWindow.didResizeNotification observer called the main-actor-isolated emit() from a nonisolated block, failing on Swift 6.1 for macOS. Same fix.
  • SelfSize: the modifier stored a derived (CGSize) -> Void closure and captured it inside onPreferenceChange. Function types are not Sendable, so this breaks under the same SDK rule. The modifier now holds the Binding directly, which is Sendable, and writes through MainActor.assumeIsolated.

No public API changes; all three modifiers are private implementation details behind trackSceneSize(), trackWindowSize() and selfSizing(_:).