Comment on page
02.使用Carthage替代CocoaPods
brew install carthage
和使用
CocoaPods
一样, 这里也需要一个无后缀的配置文件 Carthfile
熟悉
Podfile
的话这里就不会陌生了github "Alamofire/Alamofire"
- 对于
github
指名后会去github
上找对对应的库- 格式:
github Username/ProjectName
git
支持http://
git://
ssh://
==
毫无疑问是说必须为指定版本,如果没有,就不下载编译;>=
使用大于或等于指定版本的库,如果有最新,则使用最新的;~>
则是一个开区间,如“~>1.1.0”则会返回“1.1.1~1.9.9”之间的版本,不包括2.0.0;
类似
pod install
操作, cd
到工程目录执行下面命令carthage update --platform iOS
- 一般这里指定一下平台好些,否则会编译出mac,tv,iOS个平台的,完全没必要
- 执行完成后会看到有个
Carthage
目录build
中就是编译好的第三方库Checkouts
中是第三方库的缓存
手动将
先在就阔以在项目中使用
Carthage/Build
中的framework
加到项目中 


Alamofire
咯*** Skipped building R.swift due to the error:
Dependency "R.swift" has no shared framework schemes for any of the platforms: iOS
- 因为
Carthage
需要库工程的Scheme
需要为Shared
- 没有的话可能是因为
git
忽略了相应文件xcuserdata
参考
Last modified 2yr ago