Reputation: 9471
I recently updated to xCode 8 and I am choosing to stay with Swift 2.3
I am using Cocoapods to integrate Realm and it was working prior to the upgrade to xCode 8.
I searched around on Realm's GitHub and tried some solutions to no success. In my podfile I have the following lines for Realm
pod 'Realm', git: 'https://github.com/realm/realm-cocoa.git', branch: 'master', submodules: true
pod 'RealmSwift', git: 'https://github.com/realm/realm-cocoa.git', branch: 'master', submodules: true
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['SWIFT_VERSION'] = '2.3'
end
end
end
It installs successfully completes with message:
Using Realm (1.1.0) Using RealmSwift (1.1.0)
When I relaunch my application:
RLM*
FilesUmbrella header 'Realm.h not found
Cound not build Objective-C module Realm
Upvotes: 2
Views: 640
Reputation: 17
I was faced with the same problem. My Podfile looks similar to yours but I have this edit:
pod 'Realm', git: 'https://github.com/realm/realm-cocoa.git', branch: 'master', submodules: true
pod 'RealmSwift', '~> 2.3.0'
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['SWIFT_VERSION'] = '2.3'
end
end
end
As of v2.4.0, Swift 2.x is no longer supported. Realm 2.3.0 is the last stable version that supports Swift 2.3. Also as Soundshock says ensure you have 'User Legacy Swift Language version' to 'YES' for RealmSwift Pod Target. Hope this helps.
Upvotes: 0
Reputation: 485
I've had the exact same issue, and solved it my putting my 'User Legacy Swift Language version' to 'YES' for that Pod.
Upvotes: 1