How to add programmatic constraints to a UITableView?
问题 I have a class set up as follows: class SettingsController: UITableViewController { I would like to be able to add constraints to the UITableView so that there is equal spacing either side of the table (it is currently a full width table, so a little ugly on iPad). I have read that I can't add constraints to a UITableViewController , and instead I must add a UIViewController to my class, add a UITableView to that, and then I should be able to add the constraints to the TableView. I've amended