Post

Replies

Boosts

Views

Activity

SwiftUI Pull to Refresh Support
Hi, Are there plans to add Pull to Refresh support to List or ScrollView in iOS14? This is a large gap and the workarounds create other issues. Wrapping all my swiftui view content in a UIScrollView ViewRepresentable wrapper (leveraging the refreshControl property of ScrollView) causes other issues. Specifically NavigationLinks driven by Binding<Idenfiable> don’t present (presumably the nesting within a UIHostingController to sit within the UIScrollView breaks this somehow). Refresh controls usually render above the Large Navigation bar titles which aren’t exposed as Views. This means with approaches that use Preferences and geometry readers can’t get an accurate scroll offset (because large titles shrink and grow as the user scrolls) I can probably work around this by doing all my navigation in UIKit, calling back from Views to some parent object (eg Navigation Coordinator) who can then manage pushing View controllers that wrap SwiftUI views in hosting controllers. But that is not ideal. Has anyone had any luck with a Pull to refresh solution in SwiftUI with navigation? (other than introspecting the View tree for secret UITableViews etc)
32
1
18k
Jul ’20