i have started new swift project , use different libraries. in particular, use realm.io, obj-c library. but, use pure swift libraries such alamofire or dollar.
i use cocoapods managing dependencies. use latest version (0.37.0) , new use_frameworks! flag. pod install successful anytime.
unfortunately, when try build project 2 errors (for main target):
umbrella header realm.h not foundmodule.modulemapcould not build objective-c module realmfile usingimport realm
other imports work fine.
i have noticed following: if remove pure swift libs , use_frameworks, works fine. aware this current issue cocoapods. however, should not problem realm asks developers use flag.
here podfile:
platform :ios, '8.0' use_frameworks! target 'rothrock' pod 'realm' pod 'cent' pod 'swiftyjson' pod 'alamofire' end target 'rothrocktests', :exclusive => true end i use no bridging header. should i?
any idea or workaround?
alright, here full walkthrough:
- install dependencies using cocoapods ,
use_frameworks!flag. - as need use objective-c dependency, create bridging header. can create 1 importing objective-c class swift project, remove (the wizard should ask if need bridging header). otherwise, create new header file. then, navigate target configuration , enter name of file in
swift compiler - code generation>objective-c bridging header. - still in target configuration, add new entry in
search paths>user header search paths:podsvalue , flag recursive. - remove
importinstruction code, relative objective-c library. - build project. should have success.