Override func update(_ currentTime: TimeInterval)

Hello, i have one problem with my code: when i tryana to write "Override func update(_ currentTime: TimeInterval)" in my ViewController, i have this message: Method does not override any method from its superclass. Please Help

Replies

A base view controller (NSViewController or UIViewController) doesn't have an "update" method, so there's nothing to override, as the error message says.


There is an "update(_ currentTime: TimeInterval)" method in SKScene, for example, which you would normally overrride in a subclass, if you're using Sprite Kit. Maybe that's what you're trying to do?

What can i do, if i need making hitTest by frames?

You have a scene subclas, right? Put your hit-testing code in that class, not in the view controller.