Closed Sosotess93 closed 4 years ago
Hey,
I'm trying to use BATabBarController but I actually have an issue with it following the guide. My error is :
Value of type 'BATabBarController' has no member 'tabBarItems'
class BATabBarController: UITabBarController, UITabBarControllerDelegate { override func viewDidLoad() { super.viewDidLoad() let testController = BATabBarController() var tabBarItem, tabBarItem2, tabBarItem3: BATabBarItem let vc1 = UIViewController() let vc2 = UIViewController() let vc3 = UIViewController() let option1 = NSMutableAttributedString(string: "Feed") option1.addAttribute(.foregroundColor, value: UIColor.white, range: NSRange(location: 0, length: option1.length)) tabBarItem = BATabBarItem(image: UIImage(named: "icon1_unselected")!, selectedImage: UIImage(named: "icon1_selected")!, title: option1) tabBarItem2 = BATabBarItem(image: UIImage(named: "icon2_unselected")!, selectedImage: UIImage(named: "icon2_selected")!, title: option1) tabBarItem3 = BATabBarItem(image: UIImage(named: "icon3_unselected")!, selectedImage: UIImage(named: "icon3_selected")!, title: option1) let badge = BATabBarBadge(value:20, badgeColor: .red) tabBarItem2.badge = badge testController.delegate = self testController.viewControllers = [vc1, vc2, vc3] testController.tabBarItems = [tabBarItem,tabBarItem2,tabBarItem3] self.view.addSubview(testController.view) }
Here is my code.
Hey,
I'm trying to use BATabBarController but I actually have an issue with it following the guide. My error is :
Here is my code.