I am using both UITableViewController and UITableView in one project.
An UITableView in an UITableViewController overlays the home indicator on iPhone X.
But an UITableView in an UIViewController doesn't overlay the home indicator on iPhone X.
Should I fit one?
And which one is correct when I consider about safe area?
e.x.


The home indicator (If I'm getting the name correct) is that little bar at the bottom of an iPhone screen that you swipe up in order to return to the home screen. This bar replaced the home button / finger print scanner of older models.
You simply need to tap Start (or Resume, if you've triple-clicked a second time) to enter Guided Access mode, in which the Home bar is disabled.
You can continue to use a UITableView on a standard UIViewController. Just set auto layout so the bottom of the tableview is flush with the bottom of the superview (and not the margin). Then set the insetsContentViewsToSafeArea property of the tableview to true
Swift:
if #available(iOS 11.0, *) {
tableView.insetsContentViewsToSafeArea = true;
}
Objective-C:
if (@available(iOS 11.0, *)) {
[tableView setInsetsContentViewsToSafeArea:YES];
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With