I'm trying to port my code from obj-c to swift, but experienced a lot of troubles.
one of the issues is overriding pointInside of a UIView class:
class MyView : UIView{
func pointInside(point: CGPoint, withEvent event: UIEvent) -> Bool {
if point.x < 0 {
return false
} else {
return true
}
}}
if I don't add "override", I will get this error:
/xxx.swift:37:10: Method 'pointInside(_:withEvent:)' with Objective-C selector 'pointInside:withEvent:' conflicts with method 'pointInside(_:withEvent:)' from superclass 'UIView' with the same Objective-C selector
If I add "override", I will get this error:
/xxx.swift:37:19: Method does not override any method from its superclass
according to the doc, there should be a pointInside function