Rajneesh071 Rajneesh071 - 1 year ago 120
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

[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 Source

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

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download