I looked at all of the answers here Why is there extra padding at the top of my UITableView with style UITableViewStyleGrouped in iOS7 and none of them worked.
I have a table view within a UIViewController, and a collection view inside the header of the table view so that I can have a parallax scrolling effect. When the view first loads, there's no empty space above the first cell. After tapping a new item in the collection view, the table view is reloaded and the empty space appears. A curious thing is that this bug is only presenting itself on the iPad Pro (simulator). I tested on the simulator for the iPad 2 and iPad Air (1 & 2) and there's no issue. Please see the attached images.
Consolidated list of things I have tried:
- Setting self.edgesForExtendedLayout = UIRectEdge.None in viewDidLoad()
- Setting self.automaticallyAdjustsScrollViewInsets = false
- Returning 0 for heightForHeaderInSection
- Unchecking "extend under top bars" and "under bottom bars" in IB