我发现很难解决这个错误,请谁能帮助我 xcode 7 beta 2
设置UITouch?没有名为Generator
的成员
override func touchesCancelled(touches: Set<UITouch>?, withEvent event: UIEvent?) {
for obj in touches {
if let touch = obj as? UITouch {
let view = self.touchToView[touch]
self.handleControl(view, controlEvent: .TouchCancel)
self.touchToView[touch] = nil
}
}
}
}
答案 0 :(得分:1)
您需要打开可选项 - 尝试
for obj in touches! {
// code here
}