第一步:参考
第二步:
1.你需要首先在项目根目录命令行执行pod init
这样会在根目录下生成一个文件:Podfile。图1.
2.然后在Podfile里写上 pod 'Toast', '~> 3.1.0',关闭保存,在根目录命令行执行:pod install --verbose
。执行完毕后出现.xcworkspace,打开。
图1.
图2.
出现以下问题解决办法:
CDN: trunk URL couldn't be downloaded: https://raw.githubusercontent.com/CocoaPods/Specs/master/Specs/4/2/4/Toast-Swift/5.0.1/Toast-Swift.podspec.json, error: Failed to open TCP connection to raw.githubusercontent.com:443 (Connection refused - connect(2) for "raw.githubusercontent.com" port 443)
执行:
pod repo remove trunk