Skip to content

Commit e5f70b3

Browse files
committed
Fix Swift compiler warnings
- ConnectButton: activate the orphaned lessThanOrEqualTo bottom constraint so its return value is not ignored. - SignInWithAppleAuthentication: handle ASAuthorizationError.Code cases added after the SDK's iOS 14.2 deployment target behind availability checks: .notInteractive -> .notHandled .matchedExcludedCredential -> .failed .credentialImport -> .failed .credentialExport -> .failed so the switch is exhaustive on current SDKs and each new case surfaces the closest meaningful AuthenticationError.
1 parent dbe7c1d commit e5f70b3

2 files changed

Lines changed: 27 additions & 1 deletion

File tree

IFTTT SDK/ConnectButton.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ public class ConnectButton: UIView {
345345
footerLabel.constrain.edges(to: footerLabelContainer, edges: [.left, .top, .right])
346346

347347
// But allow it to be shorter than its container
348-
footerLabel.bottomAnchor.constraint(lessThanOrEqualTo: footerLabelContainer.bottomAnchor)
348+
footerLabel.bottomAnchor.constraint(lessThanOrEqualTo: footerLabelContainer.bottomAnchor).isActive = true
349349
let breakableBottomConstraint = footerLabel.bottomAnchor.constraint(equalTo: footerLabelContainer.bottomAnchor)
350350
breakableBottomConstraint.priority = .defaultHigh
351351

IFTTT SDK/SignInWithAppleAuthentication.swift

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,32 @@ final class AppleSignInWebService: ServiceAuthentication {
4141
@available(iOS 13.0, *)
4242
func authorizationController(controller: ASAuthorizationController, didCompleteWithError error: Error) {
4343
let authorizationError = ASAuthorizationError(_nsError: error as NSError)
44+
// Cases added after the SDK's iOS 14.2 deployment target,
45+
// referenced behind availability checks and mapped to the
46+
// closest equivalent AuthenticationError:
47+
// - .notInteractive → .notHandled (the system could not
48+
// present the authorization UI in this context)
49+
// - .matchedExcludedCredential → .failed (request denied
50+
// because the credential is on the exclude list)
51+
// - .credentialImport / .credentialExport → .failed
52+
// (credential transfer operation did not succeed)
53+
if #available(iOS 15.4, *), authorizationError.code == .notInteractive {
54+
completion(.failure(.notHandled))
55+
return
56+
}
57+
if #available(iOS 18.0, *), authorizationError.code == .matchedExcludedCredential {
58+
completion(.failure(.failed))
59+
return
60+
}
61+
if #available(iOS 18.2, *), authorizationError.code == .credentialImport {
62+
completion(.failure(.failed))
63+
return
64+
}
65+
if #available(iOS 18.2, *), authorizationError.code == .credentialExport {
66+
completion(.failure(.failed))
67+
return
68+
}
69+
4470
switch authorizationError.code {
4571
case .canceled:
4672
completion(.failure(.userCanceled))

0 commit comments

Comments
 (0)