Closed wilz05 closed 5 years ago
@wilz05 Hi, AZTabBarController is not a sub class of UITabBarController, and so you should not treat it as a native tab bar controller.
To add your child view controller to the tab bar simply call:
tabController.setViewController(myChildViewController, atIndex: 0)
Do not attempt to manually insert it to the controller. Hopefully this fixes your issue.
Added one empty UIViewController() tabController.setViewController(UIViewController(), atIndex: 0) It worked well, Thank you @Minitour
I'm trying to load AZTabBarController one ViewController, here is my code in viewdidload function `var icons = [UIImage]() icons.append(UIImage(named: "calendarfilter")! ) tabController = .insert(into: self, withTabIcons: icons) tabController.delegate = self let color = UIColor(red: 14.0/255, green: 122.0/255, blue: 254.0/255, alpha: 1.0) tabController.selectedColor = color tabController.highlightColor = color tabController.highlightedBackgroundColor = #colorLiteral(red: 0.1803921569, green: 0.8, blue: 0.4431372549, alpha: 1) tabController.defaultColor = .lightGray
Added backgound color to identify the issue
open class func insert(into parent:UIViewController, withTabIcons icons: [UIImage],andSelectedIcons sIcons: [UIImage]? = nil)->AZTabBarController { let controller = AZTabBarController(withTabIcons: icons,highlightedIcons: sIcons) parent.addChild(controller) parent.view.addSubview(controller.view) print(parent.view.bounds) controller.view.backgroundColor = UIColor.flatLime() // added controller.view.frame = parent.view.bounds controller.didMove(toParent: parent) controller.currentTabBar?.present(parent, animated: true, completion: nil) return controller }
behind flatlime color(view) existing controls from viewcontroller exist but disabled coz of AZTabBarController.view How can I solve the above issue ? Or am I missing anything ?