Skip to content

Commit 22a7d49

Browse files
committed
Change the safe area extension name
1 parent 59fde92 commit 22a7d49

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

Release Notes.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ UIColor.red.bindGeometry(to: $height) { $0.size.height }
1616

1717
Breaking changes:
1818

19-
* The `readSafeAreaInsets` `View` extension is renamed to `bindSafeAreaInsets`.
19+
* The `readSafeAreaInsets` `View` extension is renamed to `bindSafeAreaInset(of:to:)`.
2020

2121

2222
## 0.3.0

Sources/SwiftUIKit/Extension/View+Geometry.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ public extension View {
1515
to an external binding.
1616
*/
1717
func bindGeometry(
18-
to value: Binding<CGFloat>,
18+
to binding: Binding<CGFloat>,
1919
reader: @escaping (GeometryProxy) -> CGFloat) -> some View {
2020
self.background(GeometryBinding(reader: reader))
2121
.onPreferenceChange(GeometryPreference.self) {
22-
value.wrappedValue = $0
22+
binding.wrappedValue = $0
2323
}
2424
}
2525
}

Sources/SwiftUIKit/Extension/View+SafeArea.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ public extension View {
1919
the previously ignored safe areas. Just use the binding
2020
to set the edge padding of the view you want to inset.
2121
*/
22-
func bindSafeAreaInsets(
23-
for edge: Edge,
22+
func bindSafeAreaInset(
23+
of edge: Edge,
2424
to binding: Binding<CGFloat>) -> some View {
2525
self.bindGeometry(to: binding) {
2626
self.inset(for: $0, edge: edge)

0 commit comments

Comments
 (0)