From 15d664c79e4a1ff7e715c73392847749285ab3ad Mon Sep 17 00:00:00 2001 From: Varun Santhanam Date: Sat, 30 Sep 2023 14:08:46 -0700 Subject: [PATCH] Migrate to Swift 5.9 Toolchain (#30) --- .github/workflows/xcodebuild-build-test.yml | 2 +- .swiftformat | 4 ++-- Package.swift | 2 +- README.md | 2 +- Sources/SafariUI/SafariUI.swift | 2 +- Sources/SafariView/DismissButtonStyle.swift | 8 ++++---- Sources/SafariView/Environment.swift | 2 +- Sources/SafariView/ExcludedActivityTypes.swift | 2 +- Sources/SafariView/IncludedActivities.swift | 2 +- Sources/SafariView/Modifiers.swift | 2 +- Sources/SafariView/Presentation.swift | 2 +- Sources/SafariView/PrewarmingToken.swift | 2 +- Sources/SafariView/SafariView.swift | 8 ++++---- Sources/WebAuthentication/Environment.swift | 2 +- Sources/WebAuthentication/Modifiers.swift | 2 +- Sources/WebAuthentication/Presentation.swift | 2 +- Sources/WebAuthentication/WebAuthentication.swift | 2 +- 17 files changed, 24 insertions(+), 24 deletions(-) diff --git a/.github/workflows/xcodebuild-build-test.yml b/.github/workflows/xcodebuild-build-test.yml index 4feb6a0c4..a8b70603c 100644 --- a/.github/workflows/xcodebuild-build-test.yml +++ b/.github/workflows/xcodebuild-build-test.yml @@ -12,7 +12,7 @@ jobs: steps: - uses: actions/checkout@v3 - name: Xcode Version - run: sudo xcode-select --switch /Applications/Xcode_14.3.app + run: sudo xcode-select --switch /Applications/Xcode_15.0.app - name: Lint run: swift package plugin --allow-writing-to-package-directory swiftformat --lint - name: Build & Test diff --git a/.swiftformat b/.swiftformat index 08d42374b..9cd5c04be 100644 --- a/.swiftformat +++ b/.swiftformat @@ -1,4 +1,4 @@ --enable isEmpty --disable blankLinesAtEndOfScope, blankLinesAtStartOfScope, redundantNilInit, unusedArguments, redundantParens, wrapMultilineStatementBraces, trailingCommas, braces, opaqueGenericParameters ---swiftversion 5.8 ---header "SafariUI\n{file}\n\nMIT License\n\nCopyright (c) 2021 Varun Santhanam\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the "Software"), to deal\n\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE." \ No newline at end of file +--swiftversion 5.9 +--header "SafariUI\n{file}\n\nMIT License\n\nCopyright (c) 2023 Varun Santhanam\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the "Software"), to deal\n\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE." \ No newline at end of file diff --git a/Package.swift b/Package.swift index f3248ec5b..99d700161 100644 --- a/Package.swift +++ b/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version: 5.8 +// swift-tools-version: 5.9 // The swift-tools-version declares the minimum version of Swift required to build this package. import PackageDescription diff --git a/README.md b/README.md index 96251cf44..27a50489f 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ [![MIT License](https://img.shields.io/github/license/vsanthanam/SafariUI)](https://github.com/vsanthanam/SafariUI/blob/main/LICENSE) [![Package Releases](https://img.shields.io/github/v/release/vsanthanam/SafariUI)](https://github.com/vsanthanam/SafariUI/releases) [![Build Status](https://img.shields.io/github/actions/workflow/status/vsanthanam/SafariUI/xcodebuild-build-test.yml)](https://github.com/vsanthanam/SafariUI/actions) -[![Swift Version](https://img.shields.io/badge/swift-5.8-critical)](https://swift.org) +[![Swift Version](https://img.shields.io/badge/swift-5.9-critical)](https://swift.org) [![Supported Platforms](https://img.shields.io/badge/platform-iOS%2014.0%20%7C%20Catalyst%2014.0-lightgrey)](https://developer.apple.com) A SwiftUI wrappers for `SFSafariViewController` and `ASWebAuthenticationSession` diff --git a/Sources/SafariUI/SafariUI.swift b/Sources/SafariUI/SafariUI.swift index 99f246f27..01d0e62c3 100644 --- a/Sources/SafariUI/SafariUI.swift +++ b/Sources/SafariUI/SafariUI.swift @@ -3,7 +3,7 @@ // // MIT License // -// Copyright (c) 2021 Varun Santhanam +// Copyright (c) 2023 Varun Santhanam // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the Software), to deal // diff --git a/Sources/SafariView/DismissButtonStyle.swift b/Sources/SafariView/DismissButtonStyle.swift index d71de95d2..7b34d93e1 100644 --- a/Sources/SafariView/DismissButtonStyle.swift +++ b/Sources/SafariView/DismissButtonStyle.swift @@ -3,7 +3,7 @@ // // MIT License // -// Copyright (c) 2021 Varun Santhanam +// Copyright (c) 2023 Varun Santhanam // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the Software), to deal // @@ -45,9 +45,9 @@ public extension SafariView { var uikit: SFSafariViewController.DismissButtonStyle { switch self { - case .done: return .done - case .close: return .close - case .cancel: return .cancel + case .done: .done + case .close: .close + case .cancel: .cancel } } } diff --git a/Sources/SafariView/Environment.swift b/Sources/SafariView/Environment.swift index f1fb407a9..d905f53a7 100644 --- a/Sources/SafariView/Environment.swift +++ b/Sources/SafariView/Environment.swift @@ -3,7 +3,7 @@ // // MIT License // -// Copyright (c) 2021 Varun Santhanam +// Copyright (c) 2023 Varun Santhanam // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the Software), to deal // diff --git a/Sources/SafariView/ExcludedActivityTypes.swift b/Sources/SafariView/ExcludedActivityTypes.swift index 3509f9ba9..c4cb65f8e 100644 --- a/Sources/SafariView/ExcludedActivityTypes.swift +++ b/Sources/SafariView/ExcludedActivityTypes.swift @@ -3,7 +3,7 @@ // // MIT License // -// Copyright (c) 2021 Varun Santhanam +// Copyright (c) 2023 Varun Santhanam // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the Software), to deal // diff --git a/Sources/SafariView/IncludedActivities.swift b/Sources/SafariView/IncludedActivities.swift index 353582c58..3f3ac81a8 100644 --- a/Sources/SafariView/IncludedActivities.swift +++ b/Sources/SafariView/IncludedActivities.swift @@ -3,7 +3,7 @@ // // MIT License // -// Copyright (c) 2021 Varun Santhanam +// Copyright (c) 2023 Varun Santhanam // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the Software), to deal // diff --git a/Sources/SafariView/Modifiers.swift b/Sources/SafariView/Modifiers.swift index f43a99557..4d5bace71 100644 --- a/Sources/SafariView/Modifiers.swift +++ b/Sources/SafariView/Modifiers.swift @@ -3,7 +3,7 @@ // // MIT License // -// Copyright (c) 2021 Varun Santhanam +// Copyright (c) 2023 Varun Santhanam // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the Software), to deal // diff --git a/Sources/SafariView/Presentation.swift b/Sources/SafariView/Presentation.swift index 58ed834f2..0558ad194 100644 --- a/Sources/SafariView/Presentation.swift +++ b/Sources/SafariView/Presentation.swift @@ -3,7 +3,7 @@ // // MIT License // -// Copyright (c) 2021 Varun Santhanam +// Copyright (c) 2023 Varun Santhanam // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the Software), to deal // diff --git a/Sources/SafariView/PrewarmingToken.swift b/Sources/SafariView/PrewarmingToken.swift index 2dcc940c2..6658e2fec 100644 --- a/Sources/SafariView/PrewarmingToken.swift +++ b/Sources/SafariView/PrewarmingToken.swift @@ -3,7 +3,7 @@ // // MIT License // -// Copyright (c) 2021 Varun Santhanam +// Copyright (c) 2023 Varun Santhanam // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the Software), to deal // diff --git a/Sources/SafariView/SafariView.swift b/Sources/SafariView/SafariView.swift index 8bf865007..71e01e1a8 100644 --- a/Sources/SafariView/SafariView.swift +++ b/Sources/SafariView/SafariView.swift @@ -3,7 +3,7 @@ // // MIT License // -// Copyright (c) 2021 Varun Santhanam +// Copyright (c) 2023 Varun Santhanam // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the Software), to deal // @@ -682,11 +682,11 @@ extension UIView { var controller: UIViewController? { if let nextResponder = next as? UIViewController { - return nextResponder + nextResponder } else if let nextResponder = next as? UIView { - return nextResponder.controller + nextResponder.controller } else { - return nil + nil } } diff --git a/Sources/WebAuthentication/Environment.swift b/Sources/WebAuthentication/Environment.swift index b78f3fb0a..daf3b84f9 100644 --- a/Sources/WebAuthentication/Environment.swift +++ b/Sources/WebAuthentication/Environment.swift @@ -3,7 +3,7 @@ // // MIT License // -// Copyright (c) 2021 Varun Santhanam +// Copyright (c) 2023 Varun Santhanam // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the Software), to deal // diff --git a/Sources/WebAuthentication/Modifiers.swift b/Sources/WebAuthentication/Modifiers.swift index 1d76e51c9..bda194de8 100644 --- a/Sources/WebAuthentication/Modifiers.swift +++ b/Sources/WebAuthentication/Modifiers.swift @@ -3,7 +3,7 @@ // // MIT License // -// Copyright (c) 2021 Varun Santhanam +// Copyright (c) 2023 Varun Santhanam // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the Software), to deal // diff --git a/Sources/WebAuthentication/Presentation.swift b/Sources/WebAuthentication/Presentation.swift index 7afe4b0a6..45706d4a1 100644 --- a/Sources/WebAuthentication/Presentation.swift +++ b/Sources/WebAuthentication/Presentation.swift @@ -3,7 +3,7 @@ // // MIT License // -// Copyright (c) 2021 Varun Santhanam +// Copyright (c) 2023 Varun Santhanam // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the Software), to deal // diff --git a/Sources/WebAuthentication/WebAuthentication.swift b/Sources/WebAuthentication/WebAuthentication.swift index c9e4ad767..140afa1be 100644 --- a/Sources/WebAuthentication/WebAuthentication.swift +++ b/Sources/WebAuthentication/WebAuthentication.swift @@ -3,7 +3,7 @@ // // MIT License // -// Copyright (c) 2021 Varun Santhanam +// Copyright (c) 2023 Varun Santhanam // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the Software), to deal //