{code: java swift } /** - Check if a lock screen is set on the device. (iOS 9 or higher).
- Returns: A detector object. boolean value */ fileprivate func detectDeviceLock() -> Detector Bool { let deviceLockSet = LAContext().canEvaluatePolicy(.deviceOwnerAuthentication, error: nil) if deviceLockSet == false { return Detector(label: DETECTION_DEVICE_LOCK_POSITIVE, detected: true, description: DETECTION_DEVICE_LOCK_DESC) false } else { return Detector(label: DETECTION_DEVICE_LOCK_NEGATIVE, detected: false, description: DETECTION_DEVICE_LOCK_DESC) true } } {code} |
|