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? = {
|
public static let biometricAuthentication: LocalAuthBiometricAuthentication? = {
|
||||||
let context = LAContext()
|
let context = LAContext()
|
||||||
if context.canEvaluatePolicy(LAPolicy(rawValue: Int(kLAPolicyDeviceOwnerAuthenticationWithBiometrics))!, error: nil) {
|
if context.canEvaluatePolicy(LAPolicy(rawValue: Int(kLAPolicyDeviceOwnerAuthenticationWithBiometrics))!, error: nil) {
|
||||||
if #available(iOSApplicationExtension 11.0, iOS 11.0, *) {
|
#if swift(>=5.9)
|
||||||
switch context.biometryType {
|
switch context.biometryType {
|
||||||
case .faceID://, .opticID:
|
case .faceID, .opticID:
|
||||||
return .faceId
|
return .faceId
|
||||||
case .touchID:
|
case .touchID:
|
||||||
return .touchId
|
|
||||||
case .none:
|
|
||||||
return nil
|
|
||||||
@unknown default:
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
return .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 {
|
} else {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user