Skip to content

Commit

Permalink
Bump to v2.2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
stleamist committed Aug 26, 2020
2 parents 1199bfb + 9b71132 commit 06286f4
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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"])
Expand Down
13 changes: 13 additions & 0 deletions Sources/BetterSafariView/SafariView/SafariView+View.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 06286f4

Please sign in to comment.