当元素是元组类型时,是否有扩展数组的方法?
public extension Array where Element: (timeZoneName: String, formattedName: String){
}
This declaration returns 4 errors:
- Statement cannot begin with a closure expression
- Braced block statements is an unused closure
- Expected '{' in extension
- Expected identifier for type name
我无法判断显示的错误是否准确。 有什么想法吗?
最佳答案
Swift 3 版本 appzYourLife的回答:
extension Sequence where Iterator.Element == Tuple2 {
func foo() {}
}
关于arrays - 当元素是元组时扩展数组受限,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34364344/