I currently have a simple SwiftUI ScrollView that contains a single element. I have added the .refreshable(action: )
property to allow (pull down) refreshing of the view. However, this will only display the default grey spinner when pulling to refresh. Is there a way that I can change the color/style of the spinner?
2
Answers
Add onAppear to your List and place
I want to add my approach, is a very unorthodox one and I’m not saying is "the" solution, just something to discuss, hopefully it helps someone to "test" and find a better angle.
Make your content inside a list which will give you the .refreshable modifier and will allow pull to refresh: SWIFTUI refreshable (Pull to refresh) is not working at ScrollView
Make a singleton of your UIView (this is highly unusual, but for this case may work)
Finally add this singleton view to your refresh controller and hide the original:
Gist: https://gist.github.com/Wilsonilo/309600c62c9e27385dfa5296e696b668