Hi,
Ha have create one button in center the my tabbar, in the tabBarcontroller.swift.
I need Hidden this button in my second bar (viewcontroller), but i can't access the button for hidden.
how can i do this.
I try create a func in my tabbarcontroller.swift.
but is not work for me. i can't access func in the second view.
Tks a lot.
Ha have create one button in center the my tabbar, in the tabBarcontroller.swift.
I need Hidden this button in my second bar (viewcontroller), but i can't access the button for hidden.
how can i do this.
Code Block language var button = UIButton(type: UIButton.ButtonType.custom) override func viewDidLoad() { super.viewDidLoad() translateViews() let buttonImage = UIImage(named: "AddWhite48dp") button.frame = CGRect(x: 0.0, y: 0.0, width: buttonImage!.size.width, height: buttonImage!.size.height); button.setBackgroundImage(buttonImage, for: UIControl.State()) button.backgroundColor = UIColor(red: 35.0/255.0, green: 49.0/255.0, blue: 57.0/255.0, alpha: 1) button.center = self.tabBar.center button.center.y -= self.tabBar.frame.height/3 button.layer.cornerRadius = button.frame.size.width/2 button.clipsToBounds = true button.addTarget(self, action: #selector(MainTabController.showMenu(_:)), for: UIControl.Event.touchUpInside) self.view.addSubview(button) } func hiddenButton (hidden:Bool){ button.isHidden = hidden }
I try create a func in my tabbarcontroller.swift.
but is not work for me. i can't access func in the second view.
Tks a lot.