Is it possible to cancel the TouchID alert dialog programmatically after the LAContext.evaluatePolicy
call? If yes: how?
相关问题
- Core Data lightweight migration crashes after App
- How can I implement password recovery in an iPhone
- State preservation and restoration strategies with
- “Zero out” sensitive String data in Swift
- Get the NSRange for the visible text after scroll
相关文章
- 现在使用swift开发ios应用好还是swift?
- UITableView dragging distance with UIRefreshContro
- TCC __TCCAccessRequest_block_invoke
- Where does a host app handle NSExtensionContext#co
- Swift - hide pickerView after value selected
- How do you detect key up / key down events from a
- didBeginContact:(SKPhysicsContact *)contact not in
- Attempt to present UIAlertController on View Contr
Not every API Apple publishes makes it into the documentation on developer.apple.com (or in Xcode's docs viewer). The API diffs list public APIs, so anything you see there is in the header files (see
LocalAuthentication/LAContext.h
) and the Swift interfaces generated from those headers. And anything that's in the headers is a public API, so you're free to call it.Sometimes (but not always) the undocumented APIs have decent header comments explaining how to use them... thankfully
LAContext.invalidate()
is one of these:Indeed, it looks like calling
invalidate()
while the Touch ID alert is visible should dismiss it. (I haven't tried myself.)iOS 11 update: Note that on devices with Face ID instead of Touch ID, the alert/HUD-like UI that appears when you call
LAContext.evaluatePolicy
doesn’t require or allow interaction, and dismisses itself upon successful authentication. Theoretically, theinvalidate
call still dismisses it (or the followup, actually-interactive alert that appears if Face ID doesn’t identify the user).But it might not be wise to assume that on all possible devices and authentication methods you’ll always have enough time to cancel
LAContext
authentication after asking for it.