Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add section around why we can only support all Frameworks or all Libraries #53

Open
orta opened this issue Jan 12, 2015 · 13 comments
Open

Comments

@orta
Copy link
Member

orta commented Jan 12, 2015

People will be confused. They will presume this is a choice we made for them, but without having the reasoning in the open then no-one knows why. I don't know why. This in part could go along with CocoaPods/CocoaPods#3029

@segiddins
Copy link
Member

@mrackwitz / @neonichu could either of you please do this?

@neonichu
Copy link
Member

I have to pass, because I am also not sure anymore about the reasons.

@AliSoftware
Copy link
Contributor

According to @mrackwitz in Slack just now:

[It was] to avoid complexity, because there are situations, where you wouldn't be able to ensure that you can build it in that way, and we don't have the tooling in place to check if e.g. a vendored framework is static or dynamic

@AliSoftware
Copy link
Contributor

I think we should also explain somewhere in the guides why a pod containing Swift must be compiled as a framework and can't be a static library. The reason being because of ABI compatibility issues, as the runtime is evolving (this can simply be a simple link to this Apple's blog post but it needs to be mentioned somewhere in CP guides anyway IMHO)

@drewcrawford
Copy link

So essentially the rant that originally inspired this issue's filing was correct on the facts. It's not impossible to support both, it's just a question of effort.

I think this isn’t done for a few reasons. One, it’s hard. It’s harder to write a tool that can [mix frameworks/libraries/etc.] then it is to do one.... This is all fair. The thing is, either it’s worth doing it to share code with each other or it’s not.

@scionwest
Copy link

Does this mean that you can not use a library like SSKeychain/AFNetworking with a framework like Alamofire on the same project via cocoapods?

@segiddins
Copy link
Member

@scionwest no, since those libraries would be built as Frameworks :)

@scionwest
Copy link

Hmm, it's weird then why as soon as I add use_frameworks! the SSKeychain & LiveSDK (only two non-frameworks I have) can no longer have their types found. I get an 'identifier not found' compiler error. While AlamoFire works fire due to being a Swift framework. I remove use_frameworks! and AlamoFire can't be found but LiveSDK & SSKeychain can be.

@orta
Copy link
Member Author

orta commented Jun 29, 2015

Probably worth making a stack overflow issue for this. As alamofire is a swift library it has to have use_frameworks.

@orta orta closed this as completed Jun 29, 2015
@orta orta reopened this Jun 29, 2015
@scionwest
Copy link

I actually do already have an issue on Stackoverflow for this. http://stackoverflow.com/q/31103831/1815321

@segiddins
Copy link
Member

You should be using modular import statements with frameworks, that will probably solve your issue.

@neonichu
Copy link
Member

Yep, only module imports work in the bridging header when using frameworks. Also, you might want to get rid of the bridging header entirely, as it is unnecessary when using frameworks, they can be imported directly in Swift.

@scionwest
Copy link

That solved my issue perfectly. Thanks for the help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants