设置<uitouch>?没有名为Generator的成员

时间:2015-07-06 16:28:18

标签: ios xcode swift xcode7

我发现很难解决这个错误,请谁能帮助我 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
            }
        }

    }
}

enter image description here

1 个答案:

答案 0 :(得分:1)

您需要打开可选项 - 尝试

for obj in touches! {
   // code here
}