How do I programmatically hide or show the START SESSION button in a scene's view controller that navigates to the next scene?
CodePudding user response:
create an outlet to your button in the view controller class:
@IBOutlet weak var startButton: UIButton!
and then in whichever function you want you can show hide it, I assume you want it hidden by default So in view did load you can do
override func viewDidLoad()
{
startButton.isHidden = true
}
and then show it somewhere else
func doSomethingAndShowButton()
{
// Do some other stuff
...
// Show the button
startButton.isHidden = false
}
CodePudding user response:
you can add tag in button and then access using tag in your code