How to add a UITableView as a subview to a UIView in xib?
问题 I have a custom view that I built using xib file. In this custom view, there is a UIView where I would like to add a static UITableView as a subview. The UITableView to be shown here is present on the storyboard and associated to a UITableViewController . I did the following: let vc = (UIStoryboard(name: "Main", bundle: nil)) .instantiateViewControllerWithIdentifier("tableController") as! TableController vc.loadViewIfNeeded() table = vc.table // this is an outlet, I'm sure it is not nil table