When most apps have no touches as user input for a short period, the system puts the device into a "sleep” state where the screen dims. This is done for the purposes of conserving power By using this property isIdleTimerDisabled we can stop the iOS screen sleeping mode. When it is set to true means the screen will never dim or sleep while your app is running. When it is set to true - we don’t want to waste users battery life UIApplication.shared.isIdleTimerDisabled = true
How to make a phone call in iOS 10 using Swift?
How can I get battery level and state (plugged in, discharging, charging, etc) in iOS?
How to prevent the screen from sleeping in iOS Programmatically?
How do i get build/version number of an iOS App?
How to take a screenshot on iOS programmatically ?