I'm new to iOS. I'm currently developing an iOS application and I have a small question to you. I have few ViewControllers which Views are the same - a tableView with some data. Only the logic is different - if you select a row, different things happen, also the rows look a little bit different, but those differences are made in the ViewControllers code. My question is, what is the proper way for creating xibs for those ViewControllers? Should I create new xib for each ViewController or just one for all of them? If one, what with the FilesOwner of xib? I set it in xCode, so should I change it or what? Is it good to have only one View? Thank you!
If all views are UITableView
s you would only need one xib file (lets name it GenericTableView.xib), add your UITableView
, connect it with the file owner which is simply a UITableViewController
. After that create separate subclasses of UITableViewController
and implement your specific behavior in there.
In your code you can the easily initiate any of your UITableViewController
subclasses with
[[MyViewController alloc] initWithNibName:@"GenericTableView" bundle:[NSBundle mainBundle]];