Listed


使用COCOAPODS

简介 #

可以说这是一个平台,因为它保存了无数的开源库。 可以说是一个工具,一个帮你管理第三方库的工具。

安装 #

pod 检查是否已经安装,如果出现pod COMMAND,说明你已经安装过了。 sudo gem install cocoapods 安装或者更新 pod search Alamofire 搜索

使用 #

在使用库时,如果有错误提示 Cannot load underlying module for ‘Alamofire’, clean然后build。issues441

卸载 #

sudo gem uninstall cocoapods 一般也用不到

参考 #

cocoapods.org
How to Use CocoaPods with Swift

Podfile示例 #

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'

target 'YNPodDemo' do
  # Comment the next line if you're not using Swift and don't want to use dynamic frameworks
  use_frameworks!

  # Pods for YNPodDemo
  pod 'Alamofire', '~>4.3.0'

  target 'YNPodDemoTests' do
    inherit! :search_paths
    # Pods for testing
  end

  target 'YNPodDemoUITests' do
    inherit! :search_paths
    # Pods for testing
  end

end