BT

Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ

Topics

Choose your language

InfoQ Homepage News CocoaPods Adds Support for Swift and iOS 8 Frameworks

CocoaPods Adds Support for Swift and iOS 8 Frameworks

Leia em Português

This item in japanese

Bookmarks

CocoaPods 0.36-beta has recently been released, providing support for iOS 8 frameworks and libraries written in the Swift language, writes Marius Rackwitz (@mrackwitz), CocoaPods core team member. This release allows pod maintainers to ensure compatibility of existing pods, while also enabling the creation of new pods for Swift libraries.

With the changes in version 0.36, CocoaPods will now to able to support popular Swift libraries such as AlamoFire, SwiftyJSON, and a growing list of others, which could only be either added manually to a project or managed through a git submodule. In addition to this, while keeping its general philosophy of generating a workspace including the user projects and a Pods project, CocoaPods will now produce a dynamic framework containing all the pods, instead of a static library.

Dynamic frameworks, though commonly available on OS X, have only become available on iOS starting with iOS 8, and the lack of support for them has often been criticized by iOS developers. Among the advantages that they bring is better encapsulation of multi-platform code thanks to “fat” binaries, resource bundling, and better handling of dependent libraries. Furthermore, frameworks are easier to add to an Xcode project since they will automatically take care of header file paths. The fact that resources will be bundled inside of the pod framework means that there will be no conflicts between resources having the same name. This will require particular care to reference the correct bundle when using a resource, though.

The number of available Pods for libraries written in the Swift language is still reduced, but an example of how to create a pod file to support a Swift dependency is provided by the Quick testing framework.

CocoaPods is an application-level dependency manager that provides a standard format for managing external libraries and their dependencies. CocoaPods has been largely successful as an alternative to the use of git submodules or manual source file inclusion to add a third-party library to a project and topped 1 million downloads last December.

Rate this Article

Adoption
Style

BT