升级到Xcode 7.0后,我将所有项目转换为Swift 2.0。但是我无法更新Carthage库,出现以下警告:
``` Failed to load plugin at: /Users/Alexandr/Library/Application Support/Developer/Shared/Xcode/Plug-ins/CocoaPodUI.xcplugin, skipping. Reason for failure: *** -[__NSPlaceholderDictionary initWithObjects:forKeys:count:]: attempt to insert nil object from objects[0] ```
还有几个错误:
``` Box/Box.swift:6:37: error: 'Printable' has been renamed to 'CustomStringConvertible' Box/Box.swift:31:10: error: 'toString' has been renamed to 'String' Box/MutableBox.swift:8:51: error: 'Printable' has been renamed to 'CustomStringConvertible' Box/MutableBox.swift:25:10: error: 'toString' has been renamed to 'String' ```
如何使用Swift 2.0版本的框架?我的carthage文件如下:
在框架末尾添加“swift 2.0”无效。
``` Failed to load plugin at: /Users/Alexandr/Library/Application Support/Developer/Shared/Xcode/Plug-ins/CocoaPodUI.xcplugin, skipping. Reason for failure: *** -[__NSPlaceholderDictionary initWithObjects:forKeys:count:]: attempt to insert nil object from objects[0] ```
还有几个错误:
``` Box/Box.swift:6:37: error: 'Printable' has been renamed to 'CustomStringConvertible' Box/Box.swift:31:10: error: 'toString' has been renamed to 'String' Box/MutableBox.swift:8:51: error: 'Printable' has been renamed to 'CustomStringConvertible' Box/MutableBox.swift:25:10: error: 'toString' has been renamed to 'String' ```
如何使用Swift 2.0版本的框架?我的carthage文件如下:
github "Alamofire/Alamofire"
github "SwiftyJSON/SwiftyJSON"
github "ReactiveCocoa/ReactiveCocoa"
在框架末尾添加“swift 2.0”无效。
~ xcodebuild -version
Xcode 7.0
Build version 7A220
~ carthage version
0.9.1
编辑:
看起来 Alamofire
和 SwiftyJSON
已经支持 Swift 2.0
。对于 ReactiveCocoa
,我们需要添加 "swift2" 分支。
github "Alamofire/Alamofire"
github "SwiftyJSON/SwiftyJSON"
github "ReactiveCocoa/ReactiveCocoa" "swift2"
ReactiveCocoa
有另一个支持Swift 2.0
的分支。 - Gralex