参见英文答案 >
Swift 2.0 : ‘enumerate’ is unavailable: call the ‘enumerate()’ method on the sequence3个
刚刚下载了Xcode 7 Beta,并在枚举时出现此错误
刚刚下载了Xcode 7 Beta,并在枚举时出现此错误
错误:
enumerate is unavailable call the enumerate method on the sequence
func layoutSpecialKeysRow(row: [Key],keyWidth: CGFloat,gapWidth: CGFloat,leftSideRatio: CGFloat,rightSideRatio: CGFloat,micButtonRatio: CGFloat,isLandscape: Bool,frame: CGRect) -> [CGRect] { var frames = [CGRect]() var keysBeforeSpace = 0 var keysAfterSpace = 0 var reachedSpace = false for _k,key) in enumerate(row) { if key.type == Key.KeyType.Space { reachedSpace = true } else { if !reachedSpace { keysBeforeSpace += 1 } else { keysAfterSpace += 1 } } }