facebook twitter hatena line email

「Ios/swift/外部ライブラリ/インストール」の版間の差分

提供: 初心者エンジニアの簡易メモ
移動: 案内検索
(Admin がページ「Ios/swift/外部ライブラリ登録」を「Ios/swift/外部ライブラリ」に移動しました)
(Admin がページ「Ios/swift/外部ライブラリ」を「Ios/swift/外部ライブラリ/インストール」に移動しました)
(相違点なし)

2016年6月21日 (火) 18:19時点における版

macにcocoapadsをインストール

$ sudo gem update --system 
$ sudo gem install cocoapods

以下のようにエラーが返ってくる場合は

Operation not permitted - /usr/bin/fuzzy_match

このようにする(El Capitanからインストールフォルダが/usrの下へのインストールがアクセスできなくなったため)

$ sudo gem install -n /usr/local/bin cocoapods

cocoapodsのsetup

$ pod setup
> Setup completed

Podfile作成

プロジェクトDirの下で

$ pod init

以下Podfileのファイルができる

# platform :ios, '9.0'
target 'Helloworld' do
 # Comment this line if you're not using Swift and don't want to use dynamic frameworks
 use_frameworks!
 # Pods for Helloworld
 target 'HelloworldTests' do
   inherit! :search_paths
   # Pods for testing
 end
 target 'HelloworldUITests' do
   inherit! :search_paths
   # Pods for testing
 end
end

Podfile編集

こんな感じでライブラリ指定

$ vi Podfile
platform :ios,'9.0'
use_frameworks!
target 'Helloworld' do
        pod 'SDWebImage', '~>3.6'
end

pod install

$ pod install
Analyzing dependencies
Downloading dependencies
Installing SDWebImage (3.8.1)
Generating Pods project
Integrating client project

参考