I m developing an app in SwiftUI. In of my app screens I have a scrollView where I want to find if scrollView has reached its bottom or end of scroll. I m able to find content offset using GeometryReader but could not find a way to figure out the scroll end.
Below is the code I have tried:
var body: some View {
ScrollView {
GeometryReader { geometry -> Text in
print("\(self.offsetValue)")
DispatchQueue.main.async {
self.offsetValue = geometry.frame(in: .global).origin.y
}
}
}
}
Thanks in advance!!