iosipad

iOS Turn off screen iPad


Is there any way to turn off screen and adjust volume on the iPad programmatically? It can be private API as this is for personal use. I know that in iPhone you can use proximity sensor but I don't suppose this method would work on iPad.


Solution

  • You can use proximityMonitoringEnabled and proximityState to handle screen. Look at comment in this answer.

    And there is no way to adjust volume

    From developer.apple

    Global system volume, including your application's volume, is handled by iPhone OS and is not accessible by applications.