Skip to content

Instantly share code, notes, and snippets.

@benbahrenburg
Created January 1, 2017 03:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save benbahrenburg/c806fc5dbb5cb5fba6f68237e84efc42 to your computer and use it in GitHub Desktop.
Save benbahrenburg/c806fc5dbb5cb5fba6f68237e84efc42 to your computer and use it in GitHub Desktop.
Use LAContext to check if the device has a passcode
public func devicePasscodeEnabled() -> Bool {
return LAContext().canEvaluatePolicy(.deviceOwnerAuthentication, error: nil)
}
@haemi
Copy link

haemi commented Nov 3, 2022

is this expected behavior that it always returns true on the simulator?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment