From b715375825ceac7f1fe513a1d40a12cf057bd003 Mon Sep 17 00:00:00 2001 From: Dongkyu Kim Date: Wed, 26 Aug 2020 21:17:00 +0900 Subject: [PATCH 1/3] Add Swift 5.2 compatibility --- .../SafariView/SafariView+View.swift | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Sources/BetterSafariView/SafariView/SafariView+View.swift b/Sources/BetterSafariView/SafariView/SafariView+View.swift index 5fceac2..747b8eb 100644 --- a/Sources/BetterSafariView/SafariView/SafariView+View.swift +++ b/Sources/BetterSafariView/SafariView/SafariView+View.swift @@ -4,6 +4,8 @@ import SafariServices // A `View` conformance for the advanced usage. extension SafariView: View { + #if compiler(>=5.3) + // To apply `ignoresSafeArea(_:edges:)` modifier to the `UIViewRepresentable`, // define nested `Representable` struct and wrap it with `View`. public var body: some View { @@ -31,6 +33,17 @@ extension SafariView: View { public func accentColor(_ accentColor: Color?) -> Self { return self.preferredControlAccentColor(accentColor) } + + #else + + // To apply `ignoresSafeArea(_:edges:)` modifier to the `UIViewRepresentable`, + // define nested `Representable` struct and wrap it with `View`. + public var body: some View { + Representable(parent: self) + .edgesIgnoringSafeArea(.all) + } + + #endif } extension SafariView { From db464a99dcd5463dad35760f92bd6ae7dc81c7c0 Mon Sep 17 00:00:00 2001 From: Dongkyu Kim Date: Wed, 26 Aug 2020 21:21:08 +0900 Subject: [PATCH 2/3] Update CHANGELOG --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 500d28d..2c6aa60 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## [v2.2.1](https://github.com/stleamist/BetterSafariView/releases/tag/v2.2.1) (2020-08-26) +### Fixed +- Fixed an issue where the package could not be compiled on Swift 5.2 or earlier. + ## [v2.2.0](https://github.com/stleamist/BetterSafariView/releases/tag/v2.2.0) (2020-08-26) ### Added - `SafariView` now conforms to `View` protocol, so it can be used even in the `.sheet()` or the `.fullScreenCover()` modifiers for the advanced usage. From 9b711325c83a2aa2235d6831260960a1a7ac678e Mon Sep 17 00:00:00 2001 From: Dongkyu Kim Date: Wed, 26 Aug 2020 21:21:13 +0900 Subject: [PATCH 3/3] Update README --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index dd51819..1328e0a 100644 --- a/README.md +++ b/README.md @@ -151,7 +151,7 @@ struct ContentView: View { 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.2.0")) +.package(url: "https://github.com/stleamist/BetterSafariView.git", .upToNextMajor(from: "2.2.1")) ``` Next, add `BetterSafariView` as a dependency for your targets: @@ -170,7 +170,7 @@ import PackageDescription let package = Package( name: "MyPackage", dependencies: [ - .package(url: "https://github.com/stleamist/BetterSafariView.git", .upToNextMajor(from: "2.2.0")) + .package(url: "https://github.com/stleamist/BetterSafariView.git", .upToNextMajor(from: "2.2.1")) ], targets: [ .target(name: "MyTarget", dependencies: ["BetterSafariView"])