Hi folks,
I am new to SwiftUI. I've got the following small code. All I want is to refresh the List after pull-to-refresh. Is there any "reloadData" ?
Thanks in advance!
I am new to SwiftUI. I've got the following small code. All I want is to refresh the List after pull-to-refresh. Is there any "reloadData" ?
Thanks in advance!
Code Block language import SwiftUI import SwiftUIRefresh struct ContentViewFavorite: View { let posts = Data.posts() @State private var isShowing = false var body: some View { List { ForEach(posts) { post in PostViewFavorite(post: post) }.padding(.all, 20) }.pullToRefresh(isShowing: $isShowing) { self.isShowing = false } } } struct ContentViewFavorite_Previews: PreviewProvider { static var previews: some View { ContentViewFavorite() } }