SwiftUI-usable WKWebView and UIScrollView with advanced scroll

Ant-SwiftUIScrollView

SwiftUI-usable WKWebView and UIScrollView with advanced scroll

Makes you able to enables / disables the scroll, tracks the current scroll position.

Plus, you can check for the loading state of the webview.

Previews

WebView loadingScroll position trackingNested scroll control
123

Usage

FunctionAntWebViewAntObservableScrollViewAntControllableScrollView
Enables / disables the scrollOOX (Use introspect)
Scroll position trackingOOO
Scrolls to specific pointXOO
Loading completion listeningOXX

Currently, the AntControllableScrollView is unstable due to its UIKit feature.

Thus, use the AntObservableScrollView instead and use SwiftUI-Introspect to enable or disable the scroll event.

AntWebView(
    urlString,
    isScrollable: $scrollEnabled
) { loading, error in
    print("loading status : \(loading)")
    showProgressCircle = loading
} onScroll: { point, isScrollingUp in
    print("Where am I : \(point)")
    print("Am I going up ? : \(isScrollingUp)")
    scrollPosition = point
}.frame(
    minWidth: 0,
    maxWidth: .infinity,
    minHeight: 0,
    maxHeight: .infinity,
    alignment: .center
)

For the AntObservableScrollView,

AntObservableScrollView(content: { proxy in
    //Contents to be scrolled
    VStack {
    }
}, onScrollChanged: { point in
    print("Where am I : \(point)")
}, isScrollable: $scrollEnabled)
```ㅌ

![screen](https://github.com/Ant-tree/Ant-SwiftUIScrollView/assets/88021994/c00ec052-e816-46bc-897c-6fa3922471be)

Download details:

Author: Ant-tree
Source: https://github.com/Ant-tree/Ant-SwiftUIScrollView

#swiftui 

SwiftUI-usable WKWebView and UIScrollView with advanced scroll
1.55 GEEK