Reputation: 63
override func touchesBegan(touches: Set<NSObject>, withEvent event: UIEvent) {
}
override func supportedInterfaceOrientations() -> Int {
}
Here I have an error. It says
Method does not override any method from its superclass.
This comes multiple times, I can't fix it.
Do you know something about it?
Upvotes: 2
Views: 5148
Reputation: 107201
The error is coming because your method signature is different than the actual ones. You should use the exact method signature for overriding (Either you should use auto-complete feature provided in Xcode or refer the documentation)
override func touchesBegan(_ touches: Set<UITouch>,
with event: UIEvent?)
{
}
In Swift 3 supportedInterfaceOrientations is no longer a method, it's a computed property, so it's signature becomes:
override var supportedInterfaceOrientations : UIInterfaceOrientationMask
{
}
Upvotes: 4