The Cydia Tweak ProximityLock has been officially released and works with devices that have iOS 9 or higher. ProximityLock is a new jailbreak tweak for iPhone that lets users lock and unlock their device using just the proximity sensor. Taking advantage of the proximity sensor, the ProximityLock tweak locks the device whenever the user moves his or her hand over the sensor. So when you are using your iPhone and want to lock it, you can simply put your hand over the top section of your iPhone (where the front camera is located) and lock your device.
If you’re in to give this tweak a try, ProximityLock jailbreak tweak is available for free from BigBoss repo. Simply install the tweak on your device and configure it the way you want to use it from the preference pane which you can access from Settings app and then you are ready to make the best use of it. To install this program requires a jailbroken device (see if and how you can do the jailbreak to your iPhone by clicking here) and you need an Internet connection to download the package.