While my app is running and i press power button (To lock the device) this function is calling.
- (void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id<UIViewControllerTransitionCoordinator>)coordinator
And returning current state UIApplicationStateActive
using
[UIApplication sharedApplication].applicationState
How to prevent calling this function ? or how to ignore if power button is press? because i don't want to perform any action on powerButton press.
Precondition : Launch Screen should be present.
This function calling on app minimise and power button press due to new feature of multitasking.
You can make your application full screen to solve this problem.
Check on ✓ Requires full screen
But this is not the proper solution because you have to adopt multitasking in some case.