Skip to content

Commit 06286f4

Browse files
committed
Bump to v2.2.1
2 parents 1199bfb + 9b71132 commit 06286f4

File tree

3 files changed

+19
-2
lines changed

3 files changed

+19
-2
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.1](https://github.com/stleamist/BetterSafariView/releases/tag/v2.2.1) (2020-08-26)
4+
### Fixed
5+
- Fixed an issue where the package could not be compiled on Swift 5.2 or earlier.
6+
37
## [v2.2.0](https://github.com/stleamist/BetterSafariView/releases/tag/v2.2.0) (2020-08-26)
48
### Added
59
- `SafariView` now conforms to `View` protocol, so it can be used even in the `.sheet()` or the `.fullScreenCover()` modifiers for the advanced usage.

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.0"))
154+
.package(url: "https://github.com/stleamist/BetterSafariView.git", .upToNextMajor(from: "2.2.1"))
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.0"))
173+
.package(url: "https://github.com/stleamist/BetterSafariView.git", .upToNextMajor(from: "2.2.1"))
174174
],
175175
targets: [
176176
.target(name: "MyTarget", dependencies: ["BetterSafariView"])

Sources/BetterSafariView/SafariView/SafariView+View.swift

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ import SafariServices
44
// A `View` conformance for the advanced usage.
55
extension SafariView: View {
66

7+
#if compiler(>=5.3)
8+
79
// To apply `ignoresSafeArea(_:edges:)` modifier to the `UIViewRepresentable`,
810
// define nested `Representable` struct and wrap it with `View`.
911
public var body: some View {
@@ -31,6 +33,17 @@ extension SafariView: View {
3133
public func accentColor(_ accentColor: Color?) -> Self {
3234
return self.preferredControlAccentColor(accentColor)
3335
}
36+
37+
#else
38+
39+
// To apply `ignoresSafeArea(_:edges:)` modifier to the `UIViewRepresentable`,
40+
// define nested `Representable` struct and wrap it with `View`.
41+
public var body: some View {
42+
Representable(parent: self)
43+
.edgesIgnoringSafeArea(.all)
44+
}
45+
46+
#endif
3447
}
3548

3649
extension SafariView {

0 commit comments

Comments
 (0)