Documentation Archive Developer
Search

LocalAuthentication Changes for Swift

LocalAuthentication

Declaration
From
enum LAAccessControlOperation : Int {
    case CreateItem
    case UseItem
    case CreateKey
    case UseKeySign
}
To
enum LAAccessControlOperation : Int {
    case createItem
    case useItem
    case createKey
    case useKeySign
    case useKeyDecrypt
    case useKeyKeyExchange
}

Declaration
From
case CreateItem
To
case createItem

Declaration
From
case CreateKey
To
case createKey

Declaration
From
case UseItem
To
case useItem

Declaration
From
case UseKeySign
To
case useKeySign

Modified LAContext
DeclarationProtocols
From
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
}
--
To
class LAContext : NSObject {
    func canEvaluatePolicy(_ policy: LAPolicy, error error: NSErrorPointer) -> Bool
    func evaluatePolicy(_ policy: LAPolicy, localizedReason localizedReason: String, reply reply: @escaping (Bool, Error?) -> Swift.Void)
    func invalidate()
    func setCredential(_ credential: Data?, type type: LACredentialType) -> Bool
    func isCredentialSet(_ type: LACredentialType) -> Bool
    func evaluateAccessControl(_ accessControl: SecAccessControl, operation operation: LAAccessControlOperation, localizedReason localizedReason: String, reply reply: @escaping (Bool, Error?) -> Swift.Void)
    var localizedFallbackTitle: String?
    var localizedCancelTitle: String?
    var maxBiometryFailures: NSNumber?
    var evaluatedPolicyDomainState: Data? { get }
    var touchIDAuthenticationAllowableReuseDuration: TimeInterval
    func performSelector(onMainThread aSelector: Selector, with arg: Any?, waitUntilDone wait: Bool, modes array: [String]?)
    func performSelector(onMainThread aSelector: Selector, with arg: Any?, waitUntilDone wait: Bool)
    func perform(_ aSelector: Selector, on thr: Thread, with arg: Any?, waitUntilDone wait: Bool, modes array: [String]?)
    func perform(_ aSelector: Selector, on thr: Thread, with arg: Any?, waitUntilDone wait: Bool)
    func performSelector(inBackground aSelector: Selector, with arg: Any?)
    class func classForKeyedUnarchiver() -> AnyClass
    var classForKeyedArchiver: AnyClass? { get }
    func replacementObject(for archiver: NSKeyedArchiver) -> Any?
    class func classFallbacksForKeyedArchiver() -> [String]
    class func keyPathsForValuesAffectingValue(forKey key: String) -> Set<String>
    class func automaticallyNotifiesObservers(forKey key: String) -> Bool
    var observationInfo: UnsafeMutableRawPointer?
    func willChangeValue(forKey key: String)
    func didChangeValue(forKey key: String)
    func willChange(_ changeKind: NSKeyValueChange, valuesAt indexes: IndexSet, forKey key: String)
    func didChange(_ changeKind: NSKeyValueChange, valuesAt indexes: IndexSet, forKey key: String)
    func willChangeValue(forKey key: String, withSetMutation mutationKind: NSKeyValueSetMutationKind, using objects: Set<AnyHashable>)
    func didChangeValue(forKey key: String, withSetMutation mutationKind: NSKeyValueSetMutationKind, using objects: Set<AnyHashable>)
    func addObserver(_ observer: NSObject, forKeyPath keyPath: String, options options: NSKeyValueObservingOptions = [], context context: UnsafeMutableRawPointer?)
    func removeObserver(_ observer: NSObject, forKeyPath keyPath: String, context context: UnsafeMutableRawPointer?)
    func removeObserver(_ observer: NSObject, forKeyPath keyPath: String)
    func observeValue(forKeyPath keyPath: String?, of object: Any?, change change: [NSKeyValueChangeKey : Any]?, context context: UnsafeMutableRawPointer?)
    class var accessInstanceVariablesDirectly: Bool { get }
    func value(forKey key: String) -> Any?
    func setValue(_ value: Any?, forKey key: String)
    func validateValue(_ ioValue: AutoreleasingUnsafeMutablePointer<AnyObject?>, forKey inKey: String) throws
    func mutableArrayValue(forKey key: String) -> NSMutableArray
    func mutableOrderedSetValue(forKey key: String) -> NSMutableOrderedSet
    func mutableSetValue(forKey key: String) -> NSMutableSet
    func value(forKeyPath keyPath: String) -> Any?
    func setValue(_ value: Any?, forKeyPath keyPath: String)
    func validateValue(_ ioValue: AutoreleasingUnsafeMutablePointer<AnyObject?>, forKeyPath inKeyPath: String) throws
    func mutableArrayValue(forKeyPath keyPath: String) -> NSMutableArray
    func mutableOrderedSetValue(forKeyPath keyPath: String) -> NSMutableOrderedSet
    func mutableSetValue(forKeyPath keyPath: String) -> NSMutableSet
    func value(forUndefinedKey key: String) -> Any?
    func setValue(_ value: Any?, forUndefinedKey key: String)
    func setNilValueForKey(_ key: String)
    func dictionaryWithValues(forKeys keys: [String]) -> [String : Any]
    func setValuesForKeys(_ keyedValues: [String : Any])
    func fileManager(_ fm: FileManager, shouldProceedAfterError errorInfo: [AnyHashable : Any]) -> Bool
    func fileManager(_ fm: FileManager, willProcessPath path: String)
    func perform(_ aSelector: Selector, with anArgument: Any?, afterDelay delay: TimeInterval, inModes modes: [RunLoopMode])
    func perform(_ aSelector: Selector, with anArgument: Any?, afterDelay delay: TimeInterval)
    class func cancelPreviousPerformRequests(withTarget aTarget: Any, selector aSelector: Selector, object anArgument: Any?)
    class func cancelPreviousPerformRequests(withTarget aTarget: Any)
    func attemptRecovery(fromError error: Error, optionIndex recoveryOptionIndex: Int, delegate delegate: Any?, didRecoverSelector didRecoverSelector: Selector?, contextInfo contextInfo: UnsafeMutableRawPointer?)
    func attemptRecovery(fromError error: Error, optionIndex recoveryOptionIndex: Int) -> Bool
    var autoContentAccessingProxy: Any { get }
    class func version() -> Int
    class func setVersion(_ aVersion: Int)
    var classForCoder: AnyClass { get }
    func awakeAfter(using aDecoder: NSCoder) -> Any?
}
extension LAContext : CVarArg {
}
extension LAContext : Equatable, Hashable {
    var hashValue: Int { get }
}
CVarArg, Equatable, Hashable

Declaration
From
func evaluateAccessControl(_ accessControl: SecAccessControl, operation operation: LAAccessControlOperation, localizedReason localizedReason: String, reply reply: (Bool, NSError?) -> Void)
To
func evaluateAccessControl(_ accessControl: SecAccessControl, operation operation: LAAccessControlOperation, localizedReason localizedReason: String, reply reply: @escaping (Bool, Error?) -> Swift.Void)

Declaration
From
var evaluatedPolicyDomainState: NSData? { get }
To
var evaluatedPolicyDomainState: Data? { get }

Declaration
From
func evaluatePolicy(_ policy: LAPolicy, localizedReason localizedReason: String, reply reply: (Bool, NSError?) -> Void)
To
func evaluatePolicy(_ policy: LAPolicy, localizedReason localizedReason: String, reply reply: @escaping (Bool, Error?) -> Swift.Void)

Declaration
From
func setCredential(_ credential: NSData?, type type: LACredentialType) -> Bool
To
func setCredential(_ credential: Data?, type type: LACredentialType) -> Bool

Declaration
From
var touchIDAuthenticationAllowableReuseDuration: NSTimeInterval
To
var touchIDAuthenticationAllowableReuseDuration: TimeInterval

Declaration
From
enum LACredentialType : Int {
    case ApplicationPassword
}
To
enum LACredentialType : Int {
    case applicationPassword
}

Declaration
From
case ApplicationPassword
To
case applicationPassword

Declaration
From
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 : _BridgedNSError {
}
extension LAError : _BridgedNSError {
}
To
enum Code : Int {
        typealias _ErrorType = LAError
        case authenticationFailed
        case userCancel
        case userFallback
        case systemCancel
        case passcodeNotSet
        case touchIDNotAvailable
        case touchIDNotEnrolled
        case touchIDLockout
        case appCancel
        case invalidContext
    }

Declaration
From
case AppCancel
To
case appCancel

Declaration
From
case AuthenticationFailed
To
case authenticationFailed

Declaration
From
case InvalidContext
To
case invalidContext

Declaration
From
case PasscodeNotSet
To
case passcodeNotSet

DeclarationIntroduction
From
case SystemCancel
iOS 8.0
To
case systemCancel
iOS 10.0

Declaration
From
case TouchIDLockout
To
case touchIDLockout

DeclarationIntroduction
From
case TouchIDNotAvailable
iOS 8.0
To
case touchIDNotAvailable
iOS 10.0

DeclarationIntroduction
From
case TouchIDNotEnrolled
iOS 8.0
To
case touchIDNotEnrolled
iOS 10.0

DeclarationIntroduction
From
case UserCancel
iOS 8.0
To
case userCancel
iOS 10.0

Declaration
From
case UserFallback
To
case userFallback

Declaration
From
enum LAPolicy : Int {
    case DeviceOwnerAuthenticationWithBiometrics
    case DeviceOwnerAuthentication
}
To
enum LAPolicy : Int {
    case deviceOwnerAuthenticationWithBiometrics
    case deviceOwnerAuthentication
}

Declaration
From
case DeviceOwnerAuthentication
To
case deviceOwnerAuthentication

Declaration
From
case DeviceOwnerAuthenticationWithBiometrics
To
case deviceOwnerAuthenticationWithBiometrics

Declaration
From
let LATouchIDAuthenticationMaximumAllowableReuseDuration: NSTimeInterval
To
let LATouchIDAuthenticationMaximumAllowableReuseDuration: TimeInterval