I am building a simple app that has 2 view controller and a navigation controller to link those 2.
I have a button that takes me to the second view controller
But when I click on the button nothing happens! I have made an IBAction for it with this code inside:
@IBAction func fightButton(_ sender: UIButton) {
if let vc = storyboard?.instantiateViewController(withIdentifier: "Battle") as? BattleViewController {
navigationController?.pushViewController(vc, animated: true)
}
}
How can I fix this?