Created
May 29, 2020 23:51
-
-
Save pitt500/dbd05c667b563ebc08fb7a16b6c3bb23 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct TestPaginationView: View { | |
//1 | |
@ObservedObject var viewModel = ItemListViewModel() | |
var body: some View { | |
NavigationView { | |
//2 | |
ListPagination(items: viewModel.items, offset: 8, pagination: viewModel.getData) { item in | |
//3 | |
Text("Item #\(item)") | |
}.onAppear { | |
//4 | |
self.viewModel.getData() | |
} | |
.navigationBarTitle("Pagination Test") | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment