Skip to content

Commit 4e00a39

Browse files
authored
Add compatibility for iOS 16 and macCatalyst 16 (#12)
1 parent a417a5f commit 4e00a39

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ let package = Package(
77
name: "Recap",
88
defaultLocalization: "en",
99
platforms: [
10-
.iOS(.v17)
10+
.iOS(.v16), .macCatalyst(.v16)
1111
],
1212
products: [
1313
.library(

Sources/Recap/Internal/ReleaseView.swift

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,22 @@ struct ReleaseView: View {
2727
.padding(.leading, self.padding.leading)
2828
.padding(.trailing, self.padding.trailing)
2929
}
30-
.scrollBounceBehavior(.basedOnSize)
30+
.withSizedBasedBounceBehaviorIfAvailable()
3131
}
3232
.padding(.top, self.padding.top)
3333
.padding(.bottom, self.padding.bottom)
3434
}
3535
}
36+
37+
// MARK: ScrollView
38+
39+
fileprivate extension ScrollView {
40+
func withSizedBasedBounceBehaviorIfAvailable() -> some View {
41+
guard #available(iOS 16.4, macCatalyst 16.4, macOS 13.3, tvOS 16.4, watchOS 9.4, *) else {
42+
return self
43+
}
44+
45+
return self
46+
.scrollBounceBehavior(.basedOnSize)
47+
}
48+
}

0 commit comments

Comments
 (0)