I have UIViewController that has a Navigation Bar. At run time, I am adding (on viewDidLoad) a UITable. The problem I have is an inconsistent behaviour of the UITableView y-position.
In viewDidLoad I set the UITableView frame to:
tableView = UITableView(frame: self.view.frame)
then:
self.view.addSubview(tableView)
The problem: on the odd occasion, and only on iphone 4s, the table is added underneath the NavigationBar resulting in the first row not being visible to the user (put another way: y-pos = 0).
If I try to set the y-pos to status bar height + nav bar height the table is always positioned too low (i.e. at the wrong y-pos)
Am I doing something wrong or have I stumbled upon random quirk of ios 9.2 & swift 2?