Pod使用

1. 用终端打开到工程根目录;

2. 输入pod init;

3. 打开Podfile文件;

4. 删除platform :ios, '9.0'和use_frameworks!前面的#,添加需要的第三方;

# Uncomment this line to define a global platform for your project

platform :ios, '9.0'

target 'TestTargetName' do

# Uncomment this line if you're using Swift or would like to use dynamic frameworks

use_frameworks!

# Pods for TestTargetName

pod 'AFNetworking', '~> 3.1.0'

target 'TestTargetNameTests' do

inherit! :search_paths

# Pods for testing

end

target 'TestTargetNameUITests' do

inherit! :search_paths

# Pods for testing

end

end

5. 上面的代码已经加入了常用的AFNetworking,实际根据需要。可以在终端输入例如:pod search AFNetworking 搜索需要的第三方;

6. 第一次加入第三方,在终端打开到工程目录用 pod install初始化,后续添加第三方使用pod update更新。

你可能感兴趣的:(Pod使用)