我想检测我的设备以检查是否启用了字母数字密码。如果没有,我的应用程序将无法启动。我在下面进行了检查,但是它只能检测是否启用了密码。Programmatically detect whether iOS passcode is enabled or not
是否有任何api可以检测到此?谢谢。
您可以使用LocalAuthentication来实现。
private func IsDeviceHasPasscode() -> Bool {
return LAContext().canEvaluatePolicy(.DeviceOwnerAuthentication, error: nil)
}
希望有帮助