2

I find it hard to fix this error please who can help me xcode 7 beta 2

Set UITouch ? does not have a member named 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

Swift2
  • 169
  • 1
  • 2
  • 9

1 Answers1

1

You need to unwrap the optional - try

for obj in touches! {
   // code here
}
Mark
  • 12,359
  • 5
  • 21
  • 37
  • I have another small mistake ... I can upload it here or simply register a new question?? – Swift2 Jul 06 '15 at 16:41
  • Probably best to open a new question. Protip - you can paste your whole code in spoilers into the question box to put the code inline :) – Mark Jul 06 '15 at 16:45