Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Grouped UITableView with static and dynamic content in iOS5 storyboard

Basically, I want to make something similar as Apple did with the Wi-Fi Networks settings on the iPad. Seemingly, there are static cells to turn WiFi on or off and a toggle to ask to join networks, and a dynamic part which shows the available wireless networks in another section. Any idea on how Apple did implement this? Is it just a dynamic UITableView with some fixed cells?

Or did they embed a UITableView in a static tableview cell in the static uitableview?

Wi-Fi Networks

I tried several approaches, adding two UITableView s (one static and one dynamic) to a UITableViewController but that did not work. I tried adding a static UITableView to a UIViewController, but apparently a static UITableView needs a UITableViewController.

The only solution I came by is on devforums but that one seems quite cumbersome to me, and might not be compatible with future versions of iOS.

like image 311
masam Avatar asked Mar 15 '12 14:03

masam


1 Answers

I did a project which uses pretty much the same approach, in one of its' views, there is one uitableview, with dynamic cells.

set section number = 3.

when setting row number in each section, return a fix number for fix cell(wifi on-off) and [array count] for dynamic(wifi stations).

when setting up cells, check what section uses indexPath.section, then configure your cell

like image 161
Jin.X Avatar answered Nov 01 '22 09:11

Jin.X