azurechen / ACTabScrollView

A fancy Menu and Pager UI extends UIScrollView with elegant, smooth and synchronized scrolling tabs.
MIT License
115 stars 35 forks source link

Refresh view #7

Closed gian123 closed 7 years ago

gian123 commented 7 years ago

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

azurechen commented 7 years ago

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

gian123 commented 7 years ago

Ok I understand , Thank you very much