I was wondering whether it is already possible to use Realm with the beta of Swift 3.0.
Although I see a RealmSwift-swift3.0 directory in in the Realm repo, I do not succeed to use it correctly. How should I install it from source?
Realm objects have bindings to SwiftUI controls and, much like toggling the bought property, they already start a realm transaction to write the changes in the database whenever you change those values.
Realm Swift is an easy to use alternative to SQLite and Core Data that makes persisting, querying, and syncing data as simple as working directly with native Swift objects. Deploy a sample appView documentation.
If your project requires encryption or speed, then Realm is an obvious choice. If your project has a complex data model that changes frequently, then Core Data might be a better choice.
You can use Realm with Swift 3.0, but take into account that the current version is still absolutely experimental.
You can clone the master branch of the realm-cocoa repo from GitHub.
Or you can use Carthage:
github "realm/realm-cocoa.git" "master"
Or if you prefer CocoaPods:
pod 'RealmSwift', :git => 'https://github.com/realm/realm-cocoa.git', :branch => 'master'
If you use Carthage, remember that you must add Realm and RealmSwift frameworks manually (ignore the IBAnimatable framework):
In fact, I have one of my projects with Xcode 8, Swift 3 and Realm, and it works perfectly :)
Starting from version 1.1.0 Realm is officially compatible with Swift 3.0/Xcode 8.0. See here.
This release brings official support for Xcode 8, Swift 2.3 and Swift 3.0. Prebuilt frameworks are now built with Xcode 7.3.1 and Xcode 8.0.
Here's an extract from the install docs :
If using Xcode 8, paste the following at the bottom of your Podfile, updating the Swift version if necessary:
post_install do |installer| installer.pods_project.targets.each do |target| target.build_configurations.each do |config| config.build_settings['SWIFT_VERSION'] = '2.3' # or '3.0' end end end
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With