Skip to content

Commit f188538

Browse files
committed
fix: isolate iOS 18 code with if compiler(>=6.0)
1 parent f341752 commit f188538

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

Sources/LocalAuthenticationProvider/LocalAuthenticationProvider.swift

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -199,10 +199,16 @@ public final class LocalAuthenticationProvider: LocalAuthenticationProviderProto
199199
logger.error("Biometric sensor data has invalid dimensions: \(localizedDescription)")
200200
return .invalidDimensions
201201
#endif
202+
#if compiler(>=6.0)
202203
case .companionNotAvailable:
203-
logger.error("Companion device not available: \(localizedDescription)")
204-
return .companionNotAvailable
205-
204+
if #available(iOS 18.0, *) {
205+
logger.error("Companion device not available: \(localizedDescription)")
206+
return .companionNotAvailable
207+
} else {
208+
logger.error("Unknown LAError: \(localizedDescription)")
209+
return .error(laError)
210+
}
211+
#endif
206212
@unknown default:
207213
logger.error("Unknown LAError: \(localizedDescription)")
208214
return .error(laError)

0 commit comments

Comments
 (0)