I have a functionality throughout my application. Now i need to call a specific function inside one view controller for some particular condition. So i tried to call, but it fails
main.swift
CommandLine.unsafeArgv.withMemoryRebound(to: UnsafeMutablePointer<Int8>.self, capacity: Int(CommandLine.argc))
{ argv in
_ = UIApplicationMain(CommandLine.argc, argv, NSStringFromClass(MyClass.self), NSStringFromClass(AppDelegate.self))
}
MyClass.swift
class MyClass: UIApplication {
func resetIdleTimer() {
}
}
MyViewController.swift
class MyViewController: UIViewController {
MyClass.resetIdleTimer(); //this causes error in
}
I need to call resetIdleTimer()
inside MyViewController
?