Post

Replies

Boosts

Views

Activity

Reply to UIRefresh not working for my project?
here you go I sent it over from Mac to here simplified a little but the same thing import SwiftUI import WebKit struct WkwebView: UIViewRepresentable { let rc = UIRefreshControl() let w = WKWebView(frame: .zero, configuration: WKWebViewConfiguration()) func refreshWebView(_ sender: UIRefreshControl) { w.reload() sender.endRefreshing() } func makeUIView(context: Context) -> WKWebView { w.load(URLRequest(url: URL(string: "https://www.")!)) rc.addTarget(self, action: #selector(refreshWebView(_:)), for: UIControl.Event.valueChanged) w.scrollView.addSubview(rc) w.scrollView.bounces = true } func updateUIView(_ uiView: WKWebView, context: UIViewRepresentableContext<WkwebView>) { } }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jul ’24
Reply to UIRefresh not working for my project?
here you go I sent it over from Mac to here simplified a little but the same thing import SwiftUI import WebKit struct WkwebView: UIViewRepresentable { let rc = UIRefreshControl() let w = WKWebView(frame: .zero, configuration: WKWebViewConfiguration()) func refreshWebView(_ sender: UIRefreshControl) { w.reload() sender.endRefreshing() } func makeUIView(context: Context) -> WKWebView { w.load(URLRequest(url: URL(string: "https://www.")!)) rc.addTarget(self, action: #selector(refreshWebView(_:)), for: UIControl.Event.valueChanged) w.scrollView.addSubview(rc) w.scrollView.bounces = true } func updateUIView(_ uiView: WKWebView, context: UIViewRepresentableContext<WkwebView>) { } }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jul ’24