mirror of
https://github.com/yattee/yattee.git
synced 2024-12-22 21:43:41 +00:00
Disable RefreshControl on iOS 16
Causes crashes
This commit is contained in:
parent
5bfdc2c79b
commit
d8bd3ef50c
@ -17,21 +17,25 @@ struct RefreshControlModifier: ViewModifier {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func body(content: Content) -> some View {
|
func body(content: Content) -> some View {
|
||||||
content
|
if #available(iOS 16.0, macOS 13.0, tvOS 16.0, *) {
|
||||||
.background(
|
return content
|
||||||
GeometryReader { geometry in
|
} else {
|
||||||
ScrollViewMatcher(
|
return content
|
||||||
onResolve: { scrollView in
|
.background(
|
||||||
refreshControl.add(to: scrollView)
|
GeometryReader { geometry in
|
||||||
},
|
ScrollViewMatcher(
|
||||||
geometryReaderFrame: $geometryReaderFrame
|
onResolve: { scrollView in
|
||||||
)
|
refreshControl.add(to: scrollView)
|
||||||
.preference(key: FramePreferenceKey.self, value: geometry.frame(in: .global))
|
},
|
||||||
.onPreferenceChange(FramePreferenceKey.self) { frame in
|
geometryReaderFrame: $geometryReaderFrame
|
||||||
self.geometryReaderFrame = frame
|
)
|
||||||
|
.preference(key: FramePreferenceKey.self, value: geometry.frame(in: .global))
|
||||||
|
.onPreferenceChange(FramePreferenceKey.self) { frame in
|
||||||
|
self.geometryReaderFrame = frame
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
)
|
||||||
)
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user