【笔记】CocoaPods学习笔记

前言

CocoaPods学习笔记

下载依赖

1
sudo gem pristine ffi --version 1.15.5

安装CocoaPods

1
2
sudo gem install cocoapods
pod setup --verbose

查看版本号

1
pod --version

初始化项目

  • Swift项目根目录下执行pod init
1
pod init
  • 执行后会在项目根目录下生成Podfile文件
Podfile
1
2
3
4
5
6
7
8
platform :ios, '9.0'

target 'demo-ios' do
use_frameworks!



end

添加依赖

CLTypingLabel:依赖名

Podfile
1
2
3
4
5
6
7
8
platform :ios, '9.0'

target 'demo-ios' do
use_frameworks!

pod 'CLTypingLabel'

end

指定版本号

CLTypingLabel:依赖名

Podfile
1
2
3
4
5
6
7
8
platform :ios, '10.0'

target 'demo-ios' do
use_frameworks!

pod 'CLTypingLabel', '~> 0.4'

end

下载依赖

1
pod install
  • 下载完依赖后,使用.xcworkspace文件继续编写代码

完成

参考文献

哔哩哔哩——疯狂滴小黑