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

Dynamic framework issues with CocoaPods and Swift #22

Closed
getaaron opened this issue Jan 7, 2015 · 9 comments
Closed

Dynamic framework issues with CocoaPods and Swift #22

getaaron opened this issue Jan 7, 2015 · 9 comments

Comments

@getaaron
Copy link

getaaron commented Jan 7, 2015

Is this correct?

  • All pods written in Swift will be built as dynamic frameworks
  • Dynamic frameworks only run on iOS 8 or later (iTunes Connect will reject apps if built for iOS 7)
  • Therefore, if authors of a project written in Swift want to provide iOS 7 support, they should instruct developers of iOS 7 apps to install these projects manually, not using CocoaPods

If this is correct, I have two suggestions:

  1. When running pod spec lint, this message:

    NOTE | ld: warning: embedded dylibs/frameworks only run on iOS 8 or later.

    should more clearly indicate the consequences

  2. CocoaPods 0.36 blog.cocoapods.org#59 should be updated to explicitly include this information, since it's a significant limitation.

@kylef
Copy link

kylef commented Jan 7, 2015

Yes this is correct (summarised this on Alamofire/Alamofire#287 (comment)).

This will be an actually lint error by the 0.36 release. Enforcing that Swift pod's platform is set correctly (see CocoaPods/CocoaPods#2963).

I think it make's sense to put this in the blog post. /cc @mrackwitz Perhaps this should also make it into the guides by the release of CocoaPods 0.36.

ArtSabintsev added a commit to ArtSabintsev/Siren that referenced this issue Jan 8, 2015
@ValCapri
Copy link

ValCapri commented Jan 9, 2015

Is there no way to provide a static framework with Swift and iOS 7+ support? Like iOS-Universal-Framework project.
For the moment, I use CocoaPods for Objective-C dependency (so it produce static library) and submodules for swift dependency.

@mrackwitz
Copy link
Member

@getaaron: As @kylef states, this will be an error, which will cause rejection of the podspec. I don't think this has to be necessarily stated into the blog post, as this is a general limitation of the OS / distribution platform and not the dependency manager.

@kylef: 👍

@ValCapri: No, static frameworks are unlinked. Swift has to be linked because of it's dynamic standard libraries.

@getaaron
Copy link
Author

@mrackwitz I think it's worth including in the blog post even though it's not a CocoaPods limitation, mostly because I suspect it will catch many people by surprise.

@AvdLee
Copy link

AvdLee commented Jan 19, 2015

Conclusion here, Cocoapods with swift support will only work on iOS 8+?

I'm thinking to start using the latest Cocoapods with Swift support for my project, where I'm supporting iOS 7+.

@neonichu
Copy link
Member

@AvdLee this is correct, Swift on iOS 7 only works if you copy the files into your application project.

@neonichu
Copy link
Member

I drafted a little paragraph that could be part of the eventual 0.36 release blog post: https://gist.github.com/neonichu/acd533ab9fcce4cf3a1b - this should avoid unnecessary discussions on whether this is a CP limitation or whether it is temporary or not, as we can already see that for some reasons people are debating this.

@getaaron
Copy link
Author

https://gist.github.com/getaaron/73a3a5eb776613681389 has some minor formatting and copy suggestions. (I also noted this in @neonichu's gist.)

@mrackwitz
Copy link
Member

Done with CocoaPods/blog.cocoapods.org@6933ae5.

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

No branches or pull requests

6 participants