We're about to start three new projects and want to use swift from the beginning. I've been looking around, but can't find an answer:
Is there any way to use/create swift based cocoapods and use that pod in a swift project?
We're about to start three new projects and want to use swift from the beginning. I've been looking around, but can't find an answer:
Is there any way to use/create swift based cocoapods and use that pod in a swift project?
Currently Swift support has not been added to Cocoapods (Check out the discussion).
More discussion links: Here and Here
Xcode does not currently support Swift static libraries either so your only solution is to build your Swift classes into a framework. That being said, the biggest issue with building a framework is that the implementation details of the framework are hidden making it more difficult to actively contribute to your framework and make changes to the code as you develop.
This makes the current popular solution to integrate via subprojects, see AlamoFire and SwiftyJSON
Theres also a discussion on the Apple Forums where they discuss the problems of Frameworks crashing on iOS 7, included below:
In one of the developer talks, they said that if the framework was optional then the main application would continue to run on iOS 7. So for example, you could package an extension with an iOS 7-compatible application, and the extension wouldn't be available but the application would still run. But if the application actually tries to load a framework, it will crash on iOS 7. They described the reason being that iOS doesn't understand the encrypted framework format they are using.
So it seems that a lot of work is underway to get this working. Currently, we build all our internal reusable components in Objective-C and all Apps in Swift.