File tree Expand file tree Collapse file tree 3 files changed +19
-2
lines changed
Sources/BetterSafariView/SafariView Expand file tree Collapse file tree 3 files changed +19
-2
lines changed Original file line number Diff line number Diff line change 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.
Original file line number Diff line number Diff line change @@ -151,7 +151,7 @@ struct ContentView: View {
151151Add 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
157157Next, add ` BetterSafariView ` as a dependency for your targets:
@@ -170,7 +170,7 @@ import PackageDescription
170170let 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" ])
Original file line number Diff line number Diff line change @@ -4,6 +4,8 @@ import SafariServices
44// A `View` conformance for the advanced usage.
55extension 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
3649extension SafariView {
You can’t perform that action at this time.
0 commit comments