Add refreshable views

This commit is contained in:
Arkadiusz Fal
2022-09-02 19:02:19 +02:00
parent 4f8ac1eadb
commit 179455bbc0
6 changed files with 36 additions and 1 deletions

View File

@@ -44,6 +44,13 @@ struct PopularView: View {
resource?.load().onCompletion { _ in
refreshControl.endRefreshing()
}
.onFailure { error in
NavigationModel.shared.presentAlert(title: "Could not refresh Trending", message: error.userMessage)
}
}
.backport
.refreshable {
resource?.load()
}
.navigationBarTitleDisplayMode(RefreshControl.navigationBarTitleDisplayMode)
#endif