When I cast UIApplication.shareApplication() to my custom class AutoLogoutUIApplication, I got an error like below when I use Swift.
Could not cast value of type 'UIApplication' (0x28f4408) to 'Porject_Name.AutoLogOutUIApplication' (0x1f50d0).
Here is my code in swift:
let app = UIApplication.sharedApplication() as! AutoLogOutUIApplication
app.enableAutoLogout = false
In objective-c :
((AutoLogOutUIApplication *)[UIApplication sharedApplication]).enableAutoLogout = NO;
Here is my AutoLogOutUIApplication class:
class AutoLogOutUIApplication: UIApplication {
//properties
}
Please help!