I am getting this Swift error:
Method does not override any method from its superclass!
Why is this appearing? The relevant code is below:
class TouchyView: UIView {
override func touchesBegan(touches: NSSet?, withEvent event: UIEvent) {
updateTouches(event.allTouches())
}
override func touchesMoved(touches: NSSet?, withEvent event: UIEvent) {
updateTouches(event.allTouches())
}
override func touchesEnded(touches: NSSet?, withEvent event: UIEvent) {
updateTouches(event.allTouches())
}
override func touchesCancelled(touches: NSSet!!, withEvent event: UIEvent) {
updateTouches(event.allTouches())
}
var touchPoints = [CGPoint]()
func updateTouches( touches: NSSet? ) {
touchPoints = []
touches?.enumerateObjectsUsingBlock() { (element,stop) in
if let touch = element as? UITouch {
switch touch.phase {
case .Began, .Moved, .Stationary:
self.touchPoints.append(touch.locationInView(self))
default:
break
}
}
}
setNeedsDisplay()
}