As of 4/27/18, this has been resolved and should now work natively.
When using the pre-built Realm Swift framework in Xcode 9.3, you will receive a message like: 'Module compiled with Swift 4.0.2 cannot be imported in Swift 4.1:'
We are in the process of addressing this. In the meantime, you have a few options:
- Manually build Realm locally after cloning our Cocoa repository. Following steps like:
$ git clone --recursive https://github.com/realm/realm-cocoa $ cd realm-cocoa $ sh build.sh ios-swift
The resulting frameworks will be a folder like: build/ios/swift-4.1
- Install the framework via Cocoapods or Carthage (detailed here under their respective tabs)
- Install an older version of Xcode (you are able to run multiple versions of XCode on the same computer)