简体   繁体   中英

Mixed language framework with Cocoapods

I'm creating Swift framework that will be distributed via Cocoapods. Inside MyFramework I use few frameworks installed via Cocoapods. Importing frameworks written in swift works fine, but I get trouble importing objc framework. I want to use CardIO inside MyFramework and add it as pods submodule, so user can optionally install it like pod 'MyFramework/CardIO'. After installing CardIO pod in MyFramework, I try to import it in MyFramework-umbrella-header like:
#import "CardIO/CardIO.h" but get the error: "Include of non-modular header inside framework module " . I also check this answer , but this doesn't work when importing objc framework. Any idea is it possible to import objc framework that installed via Cocoapods to Swift framework?

[FIXED]: The problem was in CardIO podspec, they import only .h files as source_files. So after including .m files to source files: .source_files = 'CardIO/*.{h,m}' Cocoapods generate CardIO modulemap, then it's possible to import CardIO module in Swift framework.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM