— 配制CocoaPods来管理第三方类库
Mac OSX 10.11 之后
验证是否替换成功
$ gem sources -l //输出 192:~ androidlongs$ gem sources -l *** CURRENT SOURCES *** https://ruby.taobao.org/ https://gems.ruby-china.org/ //移除地址 $ gem sources --remove https://gems.ruby-china.org/可能遇到的错误一
Library/Ruby/Site/2.0.0/rubygems.rb:270:in `find_spec_for_exe': can't find gem cocoapods (>= 0.a) (Gem::GemNotFoundException)如 pod search AFNetworking 将会输出搜索出来的 关于 AFNetworking 的相关版本信息 其中 pod ‘AFNetworking’, ‘~> 3.1.0’ 就是我们在使用 CocoaPods 配制类库中使用到的信息
-> AFNetworking (3.1.0) A delightful iOS and OS X networking framework. pod 'AFNetworking', '~> 3.1.0' - Homepage: https://github.com/AFNetworking/AFNetworking - Source: https://github.com/AFNetworking/AFNetworking.git - Versions: 3.1.0, 3.0.4, 3.0.3, 3.0.2, 3.0.1, 3.0.0, 3.0.0-beta.3, 3.0.0-beta.2, 3.0.0-beta.1, 2.6.3, 2.6.2, 2.6.1, 2.6.0, 2.5.4, 2.5.3, 2.5.2, 2.5.1, 2.5.0, 2.4.1, 2.4.0, 2.3.1, 2.3.0, 2.2.4, 2.2.3, 2.2.2, 2.2.1, 2.2.0, 2.1.0, 2.0.3, 2.0.2, 2.0.1, 2.0.0, 2.0.0-RC3, 2.0.0-RC2, 2.0.0-RC1, 1.3.4, 1.3.3, 1.3.2, 1.3.1, 1.3.0, 1.2.1, 1.2.0, 1.1.0, 1.0.1, 1.0, 1.0RC3, 1.0RC2, 1.0RC1, 0.10.1, 0.10.0, 0.9.2, 0.9.1, 0.9.0, 0.7.0, 0.5.1 [master repo] - Subspecs: - AFNetworking/Serialization (3.1.0) - AFNetworking/Security (3.1.0) - AFNetworking/Reachability (3.1.0) - AFNetworking/NSURLSession (3.1.0) - AFNetworking/UIKit (3.1.0) -> AFNetworking+AutoRetry (0.0.5) Auto Retries for AFNetworking requests pod 'AFNetworking+AutoRetry', '~> 0.0.5' - Homepage: https://github.com/shaioz/AFNetworking-AutoRetry - Source: https://github.com/shaioz/AFNetworking-AutoRetry.git - Versions: 0.0.5, 0.0.4, 0.0.3, 0.0.2, 0.0.1 [master repo] :编辑Podfile文件
//也可以直接使用文本编辑器打开 $ vi Podfile弹出的窗口中
# Uncomment the next line to define a global platform for your project # platform :ios, '9.0' target '名称' do end点击 i 进入编辑模式
# Uncomment the next line to define a global platform for your project # platform :ios, '9.0' target '名称' do pod 'AFNetworking', '~> 3.1.0' end然后输入 esc 退出编辑模式 :wq 保存退出
安装完成后,项目目录结构
常用的三方类库
pod 'AFNetworking', '~> 3.1.0' pod 'SDWebImage', '~> 4.0.0' pod 'Masonry', '~> 1.0.2' pod 'YYKit', '~> 1.0.9' pod 'MJExtension', '~> 3.0.13' pod 'SDWebImage', '~> 4.0.0' pod 'MJRefresh', '~> 3.1.12' pod 'JSONModel', '~> 1.7.0' pod 'mob_smssdk' pod 'FMDB', '~> 2.7.2' #pod 'KeyboardToolBar', '~> 2.0.1' #高德地图 pod 'AMapLocation', '~> 2.6.0' pod 'AMapSearch' pod 'AMap3DMap' 早起的年轻人 认证博客专家 移动开发 项目管理 Java 只要用心去做,每一件事情还是有可能成功的,当然成功是没有界限的,只不过是达到自己心里的那个目标,公众号:我的大前端生涯,一个爱喝茶的程序员,通常会搞搞SpringBoot 、Herbinate、Mybatiys、Android、iOS、Flutter、Vue、小程序等.