mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
Support Xcode 15 & Xcode 14
This commit is contained in:
parent
1a08a9e2ba
commit
cc2c1a1350
@ -11,20 +11,29 @@ public struct LocalAuth {
|
||||
public static let biometricAuthentication: LocalAuthBiometricAuthentication? = {
|
||||
let context = LAContext()
|
||||
if context.canEvaluatePolicy(LAPolicy(rawValue: Int(kLAPolicyDeviceOwnerAuthenticationWithBiometrics))!, error: nil) {
|
||||
if #available(iOSApplicationExtension 11.0, iOS 11.0, *) {
|
||||
switch context.biometryType {
|
||||
case .faceID://, .opticID:
|
||||
return .faceId
|
||||
case .touchID:
|
||||
return .touchId
|
||||
case .none:
|
||||
return nil
|
||||
@unknown default:
|
||||
return nil
|
||||
}
|
||||
} else {
|
||||
#if swift(>=5.9)
|
||||
switch context.biometryType {
|
||||
case .faceID, .opticID:
|
||||
return .faceId
|
||||
case .touchID:
|
||||
return .touchId
|
||||
case .none:
|
||||
return nil
|
||||
@unknown default:
|
||||
return nil
|
||||
}
|
||||
#else
|
||||
switch context.biometryType {
|
||||
case .faceID://, .opticID:
|
||||
return .faceId
|
||||
case .touchID:
|
||||
return .touchId
|
||||
case .none:
|
||||
return nil
|
||||
@unknown default:
|
||||
return nil
|
||||
}
|
||||
#endif
|
||||
} else {
|
||||
return nil
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user