I redefined moreNavigationControllertableview, but I want to use the same row, which by default is used as the native moreNavigationControllertableview datasource (tabbaritem icon, name and icon, etc.). I tried to extract a cell from an existing data source. The following is a snippet of code:
func tabBarController(tabBarController: UITabBarController, shouldSelectViewController viewController: UIViewController) -> Bool
{
if (viewController == tabBarController.moreNavigationController && tabBarController.moreNavigationController.delegate == nil)
{
if tabBarController.moreNavigationController.topViewController?.view is UITableView
{
let view:UITableView = tabBarController.moreNavigationController.topViewController?.view as! UITableView
tblDataSource = view.dataSource
view.delegate = self
view.dataSource = self
}
}
return true
}
func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell
{
let cell:UITableViewCell = tblDataSource?.tableView(tableView, cellForRowAtIndexPath: indexPath)
return cell
}
But it shows me an empty cell.
source
share