简体   繁体   中英

How to add UITableView to UIView which is already a subview?

I have specific situation for which I haven't found solution. I'm doing over storyboard. So I have ViewController on which I'm using segment control for switching subviews. Every subview is ViewController but one of them is using table view . So basically it's like this:

HomeViewController

  • FavoritesViewController
    • Table View (with custom cell)
  • GalleryViewController

How to properly set up this? Should I rename/refunction FavoritesViewController to FavoritesTableViewController or?

If there is any other question, please ask it.

UPDATE 1: FavoritesViewController is having just UIView in UI because I don't need whole UIViewController

Create an IBAction from the segmented control. Inside the handling method, use "ViewController containment" to switch between two view controllers.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM