Episode #178

Getting Started with Carthage

14 minutes
Published on July 23, 2015

This video is only available to subscribers. Get access to this video and 586 others.

In this episode we welcome our first ever guest screencaster, Sam Soffes! Sam takes us through what it takes to get started with Carthage to manage dependencies. Sam compares Carthage's approach to CocoaPods and walks through how to bring in a 3rd party library into a project.

This screencast was authored by Sam Soffes.

Episode Links

Why use Carthage?

CocoaPods’ approach is easier to use, while Carthage’s is flexible and unintrusive.

The goal of CocoaPods is listed in its README as follows:
"… to improve discoverability of, and engagement in, third party open-source libraries, by creating a more centralized ecosystem"

By contrast, Carthage has been created as a decentralized dependency manager.

  • Carthage is decentralized
  • Carthage doesn't mess with your project
  • Carthage has great support for modules since everything is a framework
  • Carthage works super well with Swift

Getting Started

  • iOS 8+ is required since Carthage builds frameworks
  • Libraries must have a framework target to use Carthage
  • Easily install with Homebrew

Integrating a Library into Your Project

  • carthage update - Update and rebuild the project's dependencies
  • carthage bootstrap — Check out and build the project's dependencies
  • Add frameworks to your project
  • Add "Run Script" build phase
  • Add Carthage to "Framework Search Paths"

This episode uses Carthage 0.7.5.