I was wondering if I can be able to detect when the user turns off the phone. Is it possible? Does apple allow it? If they do, how? Thanks.
As shutting down the device is an external event and has nothing to do with your app, you won't be able to find out if the user is trying to turn it off. The only thing you can actually find out is when your application is going to enter the background, what does not necessarily mean that the user turns the device off.
Checkout UIApplication Delegate Ref
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With