Skip to content

Commit a4a8590

Browse files
committed
Bump to v2.2.2
2 parents 59321b2 + 3c3e54c commit a4a8590

File tree

4 files changed

+13
-4
lines changed

4 files changed

+13
-4
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## [v2.2.2](https://github.com/stleamist/BetterSafariView/releases/tag/v2.2.2) (2020-09-19)
4+
### Fixed
5+
- Fixed an issue where the changes of `SafariView` and `WebAuthenticationSession` is not applied after an initialization.
6+
37
## [v2.2.1](https://github.com/stleamist/BetterSafariView/releases/tag/v2.2.1) (2020-08-26)
48
### Fixed
59
- Fixed an issue where the package could not be compiled on Swift 5.2 or earlier.

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ struct ContentView: View {
151151
Add the following line to the `dependencies` in your [`Package.swift`](https://developer.apple.com/documentation/swift_packages/package) file:
152152

153153
```swift
154-
.package(url: "https://github.com/stleamist/BetterSafariView.git", .upToNextMajor(from: "2.2.1"))
154+
.package(url: "https://github.com/stleamist/BetterSafariView.git", .upToNextMajor(from: "2.2.2"))
155155
```
156156

157157
Next, add `BetterSafariView` as a dependency for your targets:
@@ -170,7 +170,7 @@ import PackageDescription
170170
let package = Package(
171171
name: "MyPackage",
172172
dependencies: [
173-
.package(url: "https://github.com/stleamist/BetterSafariView.git", .upToNextMajor(from: "2.2.1"))
173+
.package(url: "https://github.com/stleamist/BetterSafariView.git", .upToNextMajor(from: "2.2.2"))
174174
],
175175
targets: [
176176
.target(name: "MyTarget", dependencies: ["BetterSafariView"])

Sources/BetterSafariView/SafariView/SafariViewPresenter.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ struct SafariViewPresenter<Item: Identifiable>: UIViewControllerRepresentable {
2020
}
2121

2222
func updateUIViewController(_ uiViewController: UIViewController, context: Context) {
23+
24+
// Keep the coordinator updated with a new presenter struct.
25+
context.coordinator.parent = self
2326
context.coordinator.item = item
2427
}
2528
}
@@ -30,7 +33,7 @@ extension SafariViewPresenter {
3033

3134
// MARK: Parent Copying
3235

33-
private var parent: SafariViewPresenter
36+
var parent: SafariViewPresenter
3437

3538
init(parent: SafariViewPresenter) {
3639
self.parent = parent

Sources/BetterSafariView/WebAuthenticationSession/WebAuthenticationPresenter.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ struct WebAuthenticationPresenter<Item: Identifiable>: UIViewControllerRepresent
2626
// INFO: `SFAuthenticationViewController` is a private subclass of `SFSafariViewController`.
2727
context.coordinator.setInteractiveDismissalDelegateIfPossible()
2828

29+
// Keep the coordinator updated with a new presenter struct.
30+
context.coordinator.parent = self
2931
context.coordinator.item = item
3032
}
3133
}
@@ -36,7 +38,7 @@ extension WebAuthenticationPresenter {
3638

3739
// MARK: Parent Copying
3840

39-
private var parent: WebAuthenticationPresenter
41+
var parent: WebAuthenticationPresenter
4042

4143
init(parent: WebAuthenticationPresenter) {
4244
self.parent = parent

0 commit comments

Comments
 (0)