David Gatti David Gatti - 1 year ago 161
Swift Question

Use of unresolved identifier 'LAContext' in Swift 3

Apple claims to have this class in their arsenal LAContext, but Xcode 8.1 tells me otherwise:

Use of unresolved identifier 'LAContext'

My line of code is as follows:

let context = LAContext()

To me this line of code doesn't seams to crazy ;), all the tutorial on-line make use of this no problem to check if TouchID is enabled, but in my Xcode, this is not the case.

What am I missing?

Answer Source

You need to import the LocalAuthentication framework which contains this class and other related functionality.

import LocalAuthentication
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download