Documentation Archive Developer
Search

LocalAuthentication Changes for Swift

LocalAuthentication

Modified LAContext
Declaration
From
class LAContext : NSObject {
    func canEvaluatePolicy(_ policy: LAPolicy, error error: NSErrorPointer) -> Bool
    func evaluatePolicy(_ policy: LAPolicy, localizedReason localizedReason: String!, reply reply: ((Bool, NSError!) -> Void)!)
    var localizedFallbackTitle: String!
}
To
class LAContext : NSObject {
    func canEvaluatePolicy(_ policy: LAPolicy, error error: NSErrorPointer) -> Bool
    func evaluatePolicy(_ policy: LAPolicy, localizedReason localizedReason: String, reply reply: (Bool, NSError?) -> Void)
    func invalidate()
    func setCredential(_ credential: NSData?, type type: LACredentialType) -> Bool
    func isCredentialSet(_ type: LACredentialType) -> Bool
    func evaluateAccessControl(_ accessControl: SecAccessControl, operation operation: LAAccessControlOperation, localizedReason localizedReason: String, reply reply: (Bool, NSError?) -> Void)
    var localizedFallbackTitle: String?
    var maxBiometryFailures: NSNumber?
    var evaluatedPolicyDomainState: NSData? { get }
    var touchIDAuthenticationAllowableReuseDuration: NSTimeInterval
}

Declaration
From
func evaluatePolicy(_ policy: LAPolicy, localizedReason localizedReason: String!, reply reply: ((Bool, NSError!) -> Void)!)
To
func evaluatePolicy(_ policy: LAPolicy, localizedReason localizedReason: String, reply reply: (Bool, NSError?) -> Void)

Declaration
From
var localizedFallbackTitle: String!
To
var localizedFallbackTitle: String?

DeclarationProtocolsRaw Value Type
From
enum LAError : Int {
    case AuthenticationFailed
    case UserCancel
    case UserFallback
    case SystemCancel
    case PasscodeNotSet
    case TouchIDNotAvailable
    case TouchIDNotEnrolled
}
Equatable, Hashable, RawRepresentable--
To
enum LAError : Int {
    case AuthenticationFailed
    case UserCancel
    case UserFallback
    case SystemCancel
    case PasscodeNotSet
    case TouchIDNotAvailable
    case TouchIDNotEnrolled
    case TouchIDLockout
    case AppCancel
    case InvalidContext
}
extension LAError : Hashable, Equatable, __BridgedNSError, ErrorType, RawRepresentable, _ObjectiveCBridgeableErrorType, _BridgedNSError {
}
extension LAError : Hashable, Equatable, __BridgedNSError, ErrorType, RawRepresentable, _ObjectiveCBridgeableErrorType, _BridgedNSError {
}
Equatable, ErrorType, Hashable, RawRepresentableInt

DeclarationRaw Value Type
From
enum LAPolicy : Int {
    case DeviceOwnerAuthenticationWithBiometrics
}
--
To
enum LAPolicy : Int {
    case DeviceOwnerAuthenticationWithBiometrics
    case DeviceOwnerAuthentication
}
Int