Skip to content

v0.6.1 — The iOS slice compiles

Choose a tag to compare

@SteliyanH SteliyanH released this 28 Aug 09:02
· 11 commits to main since this release
51f0d40

The iOS slice did not compile, and CI never built it. Found while checking whether anything else was needed before freezing the package.

error: capture of 'observer' with non-Sendable type 'any NSObjectProtocol'
       in a '@Sendable' closure

AudioSession.interruptions captured the observer token from addObserver(forName:) so it could remove it later. That token is any NSObjectProtocol, which is not Sendable. Rewritten on NotificationCenter.notifications(named:), which owns its own lifetime.

Also allowBluetoothallowBluetoothHFP, deprecated since iOS 8 — HFP is the profile carrying a microphone, which is the whole reason a recording session allows Bluetooth.

Why six green releases said nothing

swift test runs on macOS, where every #if os(iOS) body is excluded — 295 of this package's 1084 source lines, including all of MusicLibrary, AudioSession and VoiceoverRecorder.

So the platform this package exists for went unbuilt through six releases. Fifty-eight passing tests said nothing about it, because not one could reach the code.

CI now builds for iOS, here and across the four sibling packages. A package whose primary platform is never compiled by CI is not tested, whatever the test count says.