前言
CocoaPods 是一应用级别的依赖管理器,针对Objective-C、Swift和其他任一在Objective-C运行时上运行的语言,如RubyMotion,它为额外的库的管理提供了标准的格式。(维基百科)
下载依赖
1
| sudo gem pristine ffi --version 1.15.5
|
安装CocoaPods
1 2
| sudo gem install cocoapods pod setup --verbose
|
查看版本号
初始化项目
Podfile1 2 3 4 5 6 7 8
| platform :ios, '9.0'
target 'demo-ios' do use_frameworks!
end
|
添加依赖
CLTypingLabel:依赖名
Podfile1 2 3 4 5 6 7 8
| platform :ios, '9.0'
target 'demo-ios' do use_frameworks!
pod 'CLTypingLabel'
end
|
指定版本号
CLTypingLabel:依赖名
Podfile1 2 3 4 5 6 7 8
| platform :ios, '10.0'
target 'demo-ios' do use_frameworks!
pod 'CLTypingLabel', '~> 0.4'
end
|
下载依赖
- 下载完依赖后,使用
.xcworkspace文件继续编写代码
完成
参考文献
哔哩哔哩——疯狂滴小黑