Rajneesh071 Rajneesh071 - 5 months ago 31
Objective-C Question

viewWillTransitionToSize called even if i press power button

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.

Answer

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

enter image description here