Search code examples
iosuitableviewstaticstoryboardcell

Want to create a cool static UI but : "Static table views are only valid..."


I'm creating a view like:

enter image description here

For this I'm trying to use a Storyboard in which I add 2 TableViews (both as 'Static Cells') and then I manually add my Cell content directly from the storyboard...

In my storyboard it looks great but when I build I get:

en.lproj/MainStoryboard.storyboard: error: Illegal Configuration: Static table views are only valid when embedded in UITableViewController instances

How can I fix this error?


Solution

  • Add a UITableViewController to your view. It should hold a UITableView. Define this as a static table view, and make it grouped. Add two sections. One with one row, and the other with two rows. Add your Labels buttons and sliders to the rows again.

    I do not know why you would want to have two UITableViews here?