sudo gem install activesupport -v 4.2.6
sudo gem install cocoapods
<
sudo gem install cocoapods
- Create a new project in Xcode as you would normally.
- Open a terminal window, and
$ cdinto your project directory. - Create a Podfile. This can be done by running
$ pod init. - Open your Podfile. The first line should specify the platform and version supported.
platform :ios, '9.0'
- In order to use CocoaPods you need to define the Xcode target to link them to. So for example if you are writing an iOS app, it would be the name of your app. Create a target section by writing
target '$TARGET_NAME' doand anenda few lines after. - Add a CocoaPod by specifying
pod '$PODNAME'on a single line inside your target block.
target 'MyApp' do
pod 'ObjectiveSugar'
end
- Save your Podfile.
- Run
$ pod install - Open the
MyApp.xcworkspacethat was created. This should be the file you use everyday to create your app.
<
Integration with an existing workspace
Integrating CocoaPods with an existing workspace requires one extra line in your Podfile. Simply specify the
.xcworkspace filename in outside your target blocks like so:
workspace 'MyWorkspace'
pod install