I have added a plain UITableView in my viewcontroller. Now I need to show both plain and group tableview in the same view controller for different criteria.
How can I convert the UITableView's style from plain to group in the same viewcontroller?
I have added a plain UITableView in my viewcontroller. Now I need to show both plain and group tableview in the same view controller for different criteria.
How can I convert the UITableView's style from plain to group in the same viewcontroller?
If you are inheriting UITableViewController, you can just init tableView again.
Objective C:
self.tableView = [[UITableView alloc] initWithFrame:CGRectZero style:UITableViewStyleGrouped];
Swift 4:
self.tableView = UITableView(frame: CGRect.zero, style: .grouped)
If you need same UITableView for both Grouped and Plain table then you can create it programmatically like
In Objective-C
UITableView *myTable = [[UITableView alloc] initWithFrame:CGRectZero style:UITableViewStyleGrouped];
In Swift
let tableView = UITableView.init(frame: CGRect.zero, style: .grouped)
else you can add two different UITableViews.