當我在swift 2.1上運行時,我在我的項目中使用了_ArrayType
。我上週升級到swift 3.0.2(Xcode 8.2.1),我發現here,_ArrayType
更改爲_ArrayProtocol
,它運行良好。Swift 3.1中不提供_ArrayType或_ArrayProtocol嗎?
今天我升級了我的Xcode到8.3.1,它給了我錯誤: Use of undeclared type '_ArrayProtocol'
。這裏是我的代碼:
extension _ArrayProtocol where Iterator.Element == UInt8 {
static func stringValue(_ array: [UInt8]) -> String {
return String(cString: array)
}
}
現在有什麼問題?爲什麼_ArrayProtocol在swift 3.0.2中工作時在swift 3.1中未聲明。
另外,當我看這裏in git我看_ArrayProtocol可用。 比我看了Swift 2.1 docs我能看到'_ArrayType'在協議列表中,但在斯威夫特3.0/3.1文檔我無法看到_ArrayProtocol
。
相關http://stackoverflow.com/questions/40691327/cant-assign-the-item-in-arrayprotocol –