- DATE:
- AUTHOR:
- PowerSync Product Team
Beta Release of the PowerSync Swift SDK
We are excited to announce the Beta release of our Swift SDK. This release represents a major step forward in delivering a Swift-centric developer experience.
With this release, the SDK is now production-ready for developers who have thoroughly tested their use cases. We've made substantial improvements to address the challenges encountered in our initial Alpha version.
Evolving Towards a Better Swift Experience
Our Alpha version of the Swift SDK was generated using our Kotlin Multiplatform SDK, with SKIE and KMMBridge for interoperability. However, this approach revealed several challenges, including:
Typing Issues: Kotlin’s typing system does not map well to Swift, which led to poor type safety and requiring workarounds in Swift code.
Kotlin Functionality Exposed: Swift developers were forced to navigate Kotlin-specific types and paradigms, which wasn't intuitive.
Performance Limitations: Threading constraints required all transactions to run on the main thread, impacting application performance.
To address these issues, we've introduced a Swift-native wrapper around the Kotlin Multiplatform SDK in this Beta release.
Beta Release Improvements
The Beta release brings a more intuitive, Swift-friendly interface with significantly improved type safety. We've also resolved key performance issues, such as adding multi-threading support for transactions. These updates ensure a smoother integration and better overall developer experience. Learn more about these updates in the Notable Changes in the Beta section below.
Version 1 Release
For the V1 release, we are exploring the possibility of further reducing or even eliminating the Kotlin Multiplatform dependency, enabling us to fully leverage Swift's native features and libraries. Our ultimate goal is to deliver a Swift-centric experience for developers while maintaining compatibility with the APIs introduced in the Beta to avoid any breaking changes.
Notable Changes in the Beta
Swift Package Wrapper: Introduced a new Swift Package that provides a more Swift-native interface for developers:
Exposed Swift-native classes, structs, and types for improved developer experience.
Implemented support for default arguments.
Type Mapping Enhancements: Improved type-safety by resolving generic type mapping issues between Kotlin and Swift.
Multi-threading Support: Transactions can now be executed off the main thread, boosting performance.
Swift Package Manager (SPM) Support: The
powersync-sqlite-core
package is now available on SPM, simplifying installation and eliminating the need for CocoaPods.Independent Release Cycle: Swift SDK releases are now decoupled from Kotlin SDK deployments, enabling updates tailored specifically for Swift developers.
An independent Changelog for the Swift SDK is now available here.
Get Started
New to PowerSync Swift?
We recommend the Supabase Todo List Demo app as a starting point to using the Swift SDK. See its README for instructions to run it.
Migrating from the Alpha
If you are migrating from the Alpha version of the SDK, see these developer notes.
SDK Reference
The Swift SDK reference is available here and includes installation instructions and code snippets.
Need help / have feedback?
If you need any help getting started or have any questions, chat with us on Discord. We'd also love to hear your feedback!