Repository navigation
FRadioPlayer 0.4.0 brings Swift 6 and main-actor isolation to the library, with fixes for seeking, interruptions, stale artwork, and audio-session setup.
Highlights
- Swift 6, main-actor player: player state and observer callbacks are main-actor isolated. AVFoundation callbacks that arrive off-main cross to the main actor before changing state.
- Playback intent is preserved: seeking and interruptions no longer override a user's pause or stop.
- Audio-session ownership is configurable: apps that manage their own session can set
FRadioPlayer.configuresAudioSession = falseon the main actor, before the first access toshared. The default remainstrue.
Breaking changes
- Xcode 16+ / Swift 6 toolchain required. The library builds in Swift 6 language mode; your app can stay in Swift 5 mode.
- Call the player from the main actor, including in Swift 5 apps. Add
@MainActorto your controller, or hop withTask { @MainActor in ... }from a nonisolated context. - Seeking while paused or stopped no longer starts playback. Call
play()explicitly if your UI intends to resume after seeking.
Fixed
- Seek completions run exactly once, asynchronously on the main actor, including without a loaded item, before duration is known, and when a seek is superseded. Seek positions retain subsecond precision.
- Interruptions resume only playback that was active when the interruption began, when the system allows it, and when the user has not since paused or stopped.
- Playback after a failed stream recovers on iOS 27 by omitting a redundant explicit asset timing option. Existing custom-header asset setup is preserved.
- Late artwork from a previous station or track is discarded.
- Failed loads report
.errorwithout a transient.loadingFinishednotification. - Audio-session setup uses valid
.playbackcategory options, fixing the category error observed on a physical iPhone. - End-of-item, seek, and off-main KVO callbacks no longer mutate player state off the main actor. Late KVO from replaced items is ignored.
Testing
- 56 macOS tests and 60 iOS tests cover API contracts, callback delivery, seeking, interruption intent, audio-session configuration, artwork, playback fixtures, and recovery.
- Full local suites passed on macOS, iOS 26.5, and iOS 27. The Swift 5 demo and tvOS library SDK builds passed.
- CI passed macOS tests, iOS simulator tests, the Swift 5 demo build, and the minimum Xcode 16 build. Simulator tests now wait for boot completion.
- Simulator notification tests cover state handling; headset, AirPlay, Bluetooth, and CarPlay routing still require physical-device validation.
Demo app
- Main-actor controller and explicit actor hops in remote-command handlers.
- New app icon and Choice Classic Rock replaces the unavailable Classic Rock stream.
Requirements
iOS 14+, macOS 11+, tvOS 14+, Swift 6 toolchain / Xcode 16+. Platform minimums are unchanged.
If your dependency is pinned to 0.3.0 or restricted to the 0.3 minor series, update it to receive this release:
.package(url: "https://github.com/fethica/FRadioPlayer.git", from: "0.4.0")See the 0.4.0 migration guide for controller isolation, observer callbacks, artwork providers, seeking, and audio-session ownership.
Full Changelog: 0.3.0...0.4.0