Skip to content

Commit 2a557fd

Browse files
committed
Clean up remaining Xcode 26 warnings
- IPHONEOS_DEPLOYMENT_TARGET: bump project-level Debug/Release from 10.0 to 14.2 to match the per-target setting. The 10.0 value was outside Xcode 26's supported range (12.0-26.2.99) and triggered a deployment-target warning. - SignInWithAppleAuthentication: replace the switch over ASAuthorizationError.Code with an if/else cascade. The non-frozen enum gains new cases (notInteractive, matchedExcludedCredential, credentialImport, credentialExport) at higher deployment targets that can only be referenced behind #available. With a switch, this trips "switch must be exhaustive" even with @unknown default. An if-cascade has no exhaustiveness requirement and stays readable.
1 parent 474dfc0 commit 2a557fd

2 files changed

Lines changed: 28 additions & 37 deletions

File tree

IFTTT SDK.xcodeproj/project.pbxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1252,7 +1252,7 @@
12521252
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
12531253
GCC_WARN_UNUSED_FUNCTION = YES;
12541254
GCC_WARN_UNUSED_VARIABLE = YES;
1255-
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
1255+
IPHONEOS_DEPLOYMENT_TARGET = 14.2;
12561256
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
12571257
MTL_FAST_MATH = YES;
12581258
ONLY_ACTIVE_ARCH = YES;
@@ -1309,7 +1309,7 @@
13091309
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
13101310
GCC_WARN_UNUSED_FUNCTION = YES;
13111311
GCC_WARN_UNUSED_VARIABLE = YES;
1312-
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
1312+
IPHONEOS_DEPLOYMENT_TARGET = 14.2;
13131313
MTL_ENABLE_DEBUG_INFO = NO;
13141314
MTL_FAST_MATH = YES;
13151315
SDKROOT = iphoneos;

IFTTT SDK/SignInWithAppleAuthentication.swift

Lines changed: 26 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -40,42 +40,33 @@ final class AppleSignInWebService: ServiceAuthentication {
4040

4141
@available(iOS 13.0, *)
4242
func authorizationController(controller: ASAuthorizationController, didCompleteWithError error: Error) {
43-
let authorizationError = ASAuthorizationError(_nsError: error as NSError)
44-
// Cases added after the SDK's iOS 14.2 deployment target.
45-
// Each is referenced behind an availability check and mapped
46-
// to the matching AuthenticationError case so callers can
47-
// distinguish it from the generic .failed / .unknown bucket.
48-
if #available(iOS 15.4, *), authorizationError.code == .notInteractive {
49-
completion(.failure(.notInteractive))
50-
return
51-
}
52-
if #available(iOS 18.0, *), authorizationError.code == .matchedExcludedCredential {
53-
completion(.failure(.matchedExcludedCredential))
54-
return
55-
}
56-
if #available(iOS 18.2, *), authorizationError.code == .credentialImport {
57-
completion(.failure(.credentialImport))
58-
return
59-
}
60-
if #available(iOS 18.2, *), authorizationError.code == .credentialExport {
61-
completion(.failure(.credentialExport))
62-
return
63-
}
64-
65-
switch authorizationError.code {
66-
case .canceled:
67-
completion(.failure(.userCanceled))
68-
case .failed:
69-
completion(.failure(.failed))
70-
case .invalidResponse:
71-
completion(.failure(.invalidResponse))
72-
case .notHandled:
73-
completion(.failure(.notHandled))
74-
case .unknown:
75-
completion(.failure(.unknown))
76-
@unknown default:
77-
completion(.failure(.unknown))
43+
let code = ASAuthorizationError(_nsError: error as NSError).code
44+
// If/else cascade rather than a switch: ASAuthorizationError.Code is
45+
// non-frozen and gains new cases (notInteractive in 15.4, ...) that
46+
// can only be referenced behind #available — a switch over them
47+
// either trips "switch must be exhaustive" warnings or requires
48+
// raising the deployment target.
49+
let mapped: AuthenticationError
50+
if code == .canceled {
51+
mapped = .userCanceled
52+
} else if code == .failed {
53+
mapped = .failed
54+
} else if code == .invalidResponse {
55+
mapped = .invalidResponse
56+
} else if code == .notHandled {
57+
mapped = .notHandled
58+
} else if #available(iOS 15.4, *), code == .notInteractive {
59+
mapped = .notInteractive
60+
} else if #available(iOS 18.0, *), code == .matchedExcludedCredential {
61+
mapped = .matchedExcludedCredential
62+
} else if #available(iOS 18.2, *), code == .credentialImport {
63+
mapped = .credentialImport
64+
} else if #available(iOS 18.2, *), code == .credentialExport {
65+
mapped = .credentialExport
66+
} else {
67+
mapped = .unknown
7868
}
69+
completion(.failure(mapped))
7970
}
8071
}
8172

0 commit comments

Comments
 (0)