I've decision customizing the tableView in moreNavigationController, I tested it and work great and no problem but why am I getting error:
2020-05-31 17:16:23.395903-0600 Code Notes[1472:329155] [TableView] Warning once only: UITableView was told to layout its visible cells and other contents without being in the view hierarchy (the table view or one of its superviews has not been added to a window). This may cause bugs by forcing views inside the table view to load and perform layout without accurate information (e.g. table view bounds, trait collection, layout margins, safe area insets, etc), and will also cause unnecessary performance overhead due to extra layout passes. Make a symbolic breakpoint at UITableViewAlertForLayoutOutsideViewHierarchy to catch this in the debugger and see what caused this to occur, so you can avoid this action altogether if possible, or defer it until the table view has been added to a window. Table view: <_UIMoreListTableView: 0x13a866e00; frame = (0 44; 414 852); clipsToBounds = YES; autoresize = W+H; gestureRecognizers = ; layer = ; contentOffset: {0, 0}; contentSize: {414, 176}; adjustedContentInset: {0, 0, 0, 0}; dataSource: >
I am not sure how can I resolve it, how can I solve it? Here my codes:
if let moretableview = moreNavigationController.topViewController?.view as? UITableView {
moretableview.backgroundColor = UIColor(named: "mainbackground")
for cell in moretableview.visibleCells {
cell.backgroundColor = UIColor.clear
}
}