I have a custom tableView with a header and some sections. I am using tabs to between three viewControllers. ViewController with tableview is my home page of the app. When I first open the app every thing is okay. But if I scroll down my tableView and then move to some other viewController using tab and come back to my Home screen, TableView is presented with the section where I left. I want it to be presented with header(my viewController should be presented from top instead of middle) Here are the screen shots.
This is my home screen
And If I scroll down like below
And move to next screen using below tabBar
This is what i get when I come back to home screen
Should it not be presented same as first time ?
In your first tab's
viewControllers, add following code inside
let scrollPoint = CGPoint(x: 0, y: 0) self.tableView.setContentOffset(scrollPoint, animated: false)