How do I make the function below (when a navigation bar item is clicked) open another screen already created in Main.storyboard
?
@objc func infoTapped (sender:UIButton) {
}
How do I make the function below (when a navigation bar item is clicked) open another screen already created in Main.storyboard
?
@objc func infoTapped (sender:UIButton) {
}
There are two ways.
One of them is to create a follow in the storyboard, assign it an identifier and in this method call the function performSegue(withIdentifier: IDENTIFICADOR, sender: self)
.
The other is you instantiate the VC you want to call in this method, something like this:
if let destinationVC = storyboard?.instantiateViewController(withIdentifier: "IDENTIFICADOR_VC") {
present(destinationVC, animated: true, completion: nil)
}