-3

I need to handle the ideal timeout in the ios app using Swift. I have found some way through Objective-C but I would like to know how it can be done using Swift

Shah
  • 1
  • 2
  • 1
    Do you mean *idle* timeout? And I'd recommend posting the ways in which you've found to handle it in Objective-C. – Lyndsey Scott Jan 06 '16 at 16:14
  • I have just explored the following links [Icode blog](http://www.icodeblog.com/2011/09/19/timing-out-an-application-due-to-inactivity/) and [stackoverflow](http://stackoverflow.com/questions/273450/iphone-detecting-user-inactivity-idle-time-since-last-screen-touch) – Shah Jan 06 '16 at 16:18

1 Answers1

1

By default Ideal Timer disable value is set to NO.

You can disable Ideal Timer like this in Swift:

UIApplication.sharedApplication().idleTimerDisabled = true;

Objective C

[[UIApplication sharedApplication] setIdleTimerDisabled:YES];
technerd
  • 14,144
  • 10
  • 61
  • 92
  • This settings is for ideal timeout for enter app. I just meant need to handle the inactivity of the users in iOS App. So that after particular timing I can logout the users – Shah Jan 07 '16 at 05:26