简体   繁体   中英

Bar Button Items Won't Connect To Exit

I have two view controllers - one main VC (ViewController) and this is segue'd to another VC via "Present Modally" (DetailViewController). The ViewController is embedded in Navigation Controller whereas the DetailViewController is not embedded in anything.

In my ViewController I added two functions:

@IBAction func cancelToVC(segue: UIStoryboard) {

}

@IBAction func saveDetails(segue: UIStoryboard) {

}

So now when I go to my DetailViewController I am hoping to connect two bar button items "Cancel" and "Done" to the exit button. But it doesn't even highlight to allow me to select it. Any suggestions?

I think you should set up your IBAction func's like this:

@IBAction func cancelToVC(segue: UIStoryboardSegue) { // Not UIStoryboard

}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM