2022 / 10 / 06
pod添加第三方库
如何从本地添加私有三方库呢?(如何创建私有三方库呢?)
// 1.从本地文件夹添加
pod 'Alamofire', :path => '~/Documents/Alamofire'
// 2.从主分支添加
pod 'Alamofire', :git => 'https://github.com/Alamofire/Alamofire.git'
// 3.从次分支添加
pod'Alamofire',:git=>'https://github.com/Alamofire/Alamofire.git',:branch=>'dev'
// 4.用指定的tag
pod'Alamofire',:git=>'https://github.com/Alamofire/Alamofire.git',:tag=>'3.1.1'
// 5.用指定的commit
pod'Alamofire',:git=>'https://github.com/Alamofire/Alamofire.git',:commit=>'0f506b1c45'
// 正常添加
pod 'SDWebImage', '~> 4.3.2'
那么如何指定三方库的版本呢?
'> 0.1' :高于0.1的版本
'>=0.1' :0.1版本或者更高的版本
'<0.1' :小于0.1的版本
'<=0.1' :0.1版本或者更低的版本
'~> 0.1.2':版本0.1.2~版本0.2,不包括0.2
'~> 0.1' :版本0.1~版本1.0,不包括版本1.0