when user clicked button
let uvc: UINavigationController =
self.storyboard?.instantiateViewController(withIdentifier: "nationSelect") as! UINavigationController
uvc.modalTransitionStyle = UIModalTransitionStyle.coverVertical
self.present(uvc, animated: true, completion: nil)
run this code.
identifier:nationSelect storyboard img
cell, closebutton, VC segue unwind img
and button vc have this function
@IBAction func unwindFromPostCodeSelectionView(_ sender: UIStoryboardSegue) {
print("unwindFromPostCodeSelectionView")
}
and nationSelect VC
when collectionview's cell clicked run this code
performSegue(withIdentifier: unwind, sender: nil)
and prepare function
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
guard let identifier = segue.identifier, identifier == unwind else{
return
}
guard let vc = segue.destination as? CurationRequestViewController else {
return
}
vc.getAddress.setTitle( (continent.text ?? " ") + " " + nation , for: .normal)
}
but i got this error
* Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Receiver () has no segue with identifier 'unwind''
help me plz!!!
if-statement
:if segue.identifier == "yourId" { // Do something }
– Mannopson