azurechen/ACTabScrollView

Refresh view

Closed this issue · 2 comments

I want to refresh my uiviewcontroller view when the tab is is showing or pressed, How can i do it?

I don't suggest you replacing whole the controller.view because of the performance issue
If you just want to reload a table, using tableView.reloadData() at
func tabScrollView(_ tabScrollView: ACTabScrollView, didChangePageTo index: Int)
or
func tabScrollView(_ tabScrollView: ACTabScrollView, didScrollPageTo index: Int)
should be a better way

If you have to replace the whole view by the new controller.view, you should set the tabScrollView.cachedPageLimit to 1 and it means no cache

And you may have a contentViews: [UIView] array to store all controller.views
Update this array with the new controller.view and you will see the new view at next page change

Ok I understand , Thank you very much