インストール
$ sudo gem install cocoapods
セットアップ
$ pod setup
プロジェクトにライブラリをインストールする
$ cd [該当のプロジェクト] $ vim Podfile
Podfileの内容
platform :ios, "8.0" <-- iOS8.0以降 use_frameworks! <-- Swiftの場合記載 pod "FBSDKCoreKit"; pod "FBSDKLoginKit"; #pod "FBSDKLoginKit"; <-- # はコメント
インストール
$ pod init $ pod install
[該当プロジェクト].xcworkspace を開く
エラー
Analyzing dependencies [!] Could not automatically select an Xcode project. Specify one in your Podfile like so: xcodeproj 'path/to/Project.xcodeproj'
Podfileと同じディレクトリに、プロジェクトファイルがない(*.xproj)
公式なSpecリポジトリ
GitHub - CocoaPods/Specs: The CocoaPods Master Repo
The CocoaPods Master Repo. Contribute to CocoaPods/Specs development by creating an account on GitHub.
git上のmasterブランチを使用する場合
pod 'AFNetworking', :git => 'https://github.com/gowalla/AFNetworking.git'

コメント