From d7a3dad0e5cbbc34c96c64fe8d180fc59ea8c5fe Mon Sep 17 00:00:00 2001 From: kevvdevv <63097350+kevvdevv@users.noreply.github.com> Date: Sat, 18 Sep 2021 14:31:24 -0400 Subject: [PATCH 1/6] Update WebAuthenticationPresenter.swift --- .../WebAuthenticationSession/WebAuthenticationPresenter.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/BetterSafariView/WebAuthenticationSession/WebAuthenticationPresenter.swift b/Sources/BetterSafariView/WebAuthenticationSession/WebAuthenticationPresenter.swift index 1975e33..e99b8bd 100644 --- a/Sources/BetterSafariView/WebAuthenticationSession/WebAuthenticationPresenter.swift +++ b/Sources/BetterSafariView/WebAuthenticationSession/WebAuthenticationPresenter.swift @@ -182,7 +182,7 @@ extension WebAuthenticationPresenter { // MARK: ASWebAuthenticationPresentationContextProviding func presentationAnchor(for session: ASWebAuthenticationSession) -> ASPresentationAnchor { - return coordinator!.viewController.view.window! + ASPresentationAnchor() } } From a9b7e4b9ca24b57271878314708911ceaf8ae78f Mon Sep 17 00:00:00 2001 From: kevvdevv <63097350+kevvdevv@users.noreply.github.com> Date: Sun, 19 Sep 2021 06:51:10 -0400 Subject: [PATCH 2/6] Update WebAuthenticationPresenter.swift Added #available wrapper for ASPresentationAnchor. --- .../WebAuthenticationPresenter.swift | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Sources/BetterSafariView/WebAuthenticationSession/WebAuthenticationPresenter.swift b/Sources/BetterSafariView/WebAuthenticationSession/WebAuthenticationPresenter.swift index e99b8bd..522dc63 100644 --- a/Sources/BetterSafariView/WebAuthenticationSession/WebAuthenticationPresenter.swift +++ b/Sources/BetterSafariView/WebAuthenticationSession/WebAuthenticationPresenter.swift @@ -182,7 +182,11 @@ extension WebAuthenticationPresenter { // MARK: ASWebAuthenticationPresentationContextProviding func presentationAnchor(for session: ASWebAuthenticationSession) -> ASPresentationAnchor { - ASPresentationAnchor() + if #available(iOS 13, *, macOS 10.15, *) { + ASPresentationAnchor() + } else { + coordinator!.viewController.view.window! + } } } From ff31cf23448c8690195f2da88349c41080f6bcc7 Mon Sep 17 00:00:00 2001 From: kevvdevv <63097350+kevvdevv@users.noreply.github.com> Date: Sat, 3 Dec 2022 10:22:35 -0500 Subject: [PATCH 3/6] Update Sources/BetterSafariView/WebAuthenticationSession/WebAuthenticationPresenter.swift Co-authored-by: Dongkyu Kim (Max) --- .../WebAuthenticationPresenter.swift | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/Sources/BetterSafariView/WebAuthenticationSession/WebAuthenticationPresenter.swift b/Sources/BetterSafariView/WebAuthenticationSession/WebAuthenticationPresenter.swift index 7e66317..bbe7552 100644 --- a/Sources/BetterSafariView/WebAuthenticationSession/WebAuthenticationPresenter.swift +++ b/Sources/BetterSafariView/WebAuthenticationSession/WebAuthenticationPresenter.swift @@ -179,11 +179,7 @@ extension WebAuthenticationPresenter { // MARK: ASWebAuthenticationPresentationContextProviding func presentationAnchor(for session: ASWebAuthenticationSession) -> ASPresentationAnchor { - if #available(iOS 13, *, macOS 10.15, *) { - ASPresentationAnchor() - } else { - coordinator.view.window! - } + return coordinator.view.window ?? ASPresentationAnchor() } } From 7aeaff801a13e765172b18d70794bd37af47feb1 Mon Sep 17 00:00:00 2001 From: Dongkyu Kim Date: Sun, 15 Jan 2023 14:39:02 +0900 Subject: [PATCH 4/6] Fix typos on CHANGELOG.md --- CHANGELOG.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5f3cd81..a1602d6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,15 +1,15 @@ # Changelog -## [v2.4.0](https://github.com/stleamist/BetterSafariView/releases/tag/v2.4.0) (2020-09-25) +## [v2.4.0](https://github.com/stleamist/BetterSafariView/releases/tag/v2.4.0) (2021-09-25) ### Changed - `SafariViewPresenter` and `WebAuthenticationPresenter` now conforms to `UIViewRepresentable`, instead of `UIViewControllerRepresentable`. ### Fixed -- Fixed an issue where the `SafariView` is not presented on the multi-layered modal sheets (#20). Thanks @twodayslate! +- Fixed an issue where the `SafariView` is not presented on the multi-layered modal sheets (#20). Thanks, @twodayslate! -## [v2.3.1](https://github.com/stleamist/BetterSafariView/releases/tag/v2.3.1) (2020-01-20) +## [v2.3.1](https://github.com/stleamist/BetterSafariView/releases/tag/v2.3.1) (2021-01-20) ### Fixed -- Fixed an issue where the `SafariView` is not presented on the modal sheets (#9). Thanks @boherna! +- Fixed an issue where the `SafariView` is not presented on the modal sheets (#9). Thanks, @boherna! ## [v2.3.0](https://github.com/stleamist/BetterSafariView/releases/tag/v2.3.0) (2021-01-19) ### Added From 6ebee2da3ae7b4f97f8ed68a5dbf93b51099ae3c Mon Sep 17 00:00:00 2001 From: Dongkyu Kim Date: Sun, 15 Jan 2023 14:38:51 +0900 Subject: [PATCH 5/6] Update CHANGELOG.md --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a1602d6..ee5e1a8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## [v2.4.1](https://github.com/stleamist/BetterSafariView/releases/tag/v2.4.1) (2023-01-15) +### Fixed +- Fixed an issue where the `WebAuthenticationPresenter` fails to find its presentation anchor (#22). Thanks, @kevvdevv, @exentrich, and @ldstreet! + ## [v2.4.0](https://github.com/stleamist/BetterSafariView/releases/tag/v2.4.0) (2021-09-25) ### Changed - `SafariViewPresenter` and `WebAuthenticationPresenter` now conforms to `UIViewRepresentable`, instead of `UIViewControllerRepresentable`. From a68e3d8976a20ea6a64eac9d63f6312e28203bfe Mon Sep 17 00:00:00 2001 From: Dongkyu Kim Date: Sun, 15 Jan 2023 14:41:38 +0900 Subject: [PATCH 6/6] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index ab22bb1..1f1b3f1 100644 --- a/README.md +++ b/README.md @@ -285,7 +285,7 @@ func prefersEphemeralWebBrowserSession(_ prefersEphemeralWebBrowserSession: Bool Add the following line to the `dependencies` in your [`Package.swift`](https://developer.apple.com/documentation/swift_packages/package) file: ```swift -.package(url: "https://github.com/stleamist/BetterSafariView.git", .upToNextMajor(from: "2.4.0")) +.package(url: "https://github.com/stleamist/BetterSafariView.git", .upToNextMajor(from: "2.4.1")) ``` Next, add `BetterSafariView` as a dependency for your targets: @@ -304,7 +304,7 @@ import PackageDescription let package = Package( name: "MyPackage", dependencies: [ - .package(url: "https://github.com/stleamist/BetterSafariView.git", .upToNextMajor(from: "2.4.0")) + .package(url: "https://github.com/stleamist/BetterSafariView.git", .upToNextMajor(from: "2.4.1")) ], targets: [ .target(name: "MyTarget", dependencies: ["BetterSafariView"])