How can I detect screen lock/unlock in iOS? I am using Swift 4 (Xcode 9.2), and I have tried following links but they are not working for me.
- IOS swift 3 detect failed screen unlock?
- How can I detect screen lock/unlock events on the iPhone?
- detect screen unlock events in IOS Swift
I would be happy if someone can teach me. Thanks.