简体   繁体   中英

Perform Segue to another storyboard swift

Hey I am performing a basic segue from a ViewController in one storyboard to another ViewController second storyboard.

1st storyboard : Main

2nd Storyboard : Settings

I have a reference to settings.storyboard in Main.storyboard . below are the screen shot of my setup

Storyboard Ref to Settings in Main

在此处输入图片说明

My segue(attributes) to storyboard ref. I am using a custom segue, that slides from right to left :

在此处输入图片说明

Destination VC in settings storyboard.

在此处输入图片说明

My source VC is a navigation embedded-TableViewController, I perform following operation to segue there:

let storyboard = UIStoryboard(name: "Settings", bundle: nil)
let vc = storyboard.instantiateViewController(withIdentifier: "editprofile") as? EditProfile
performSegue(withIdentifier: "settings", sender: nil)

With the above setting I am still unable to segue to my Destination VC. I have serach stackoverflow alot and even implemented exactly, but am out of Luck. I just dont know where exactly I am going wrong.

Thanks!

The (withIdentifier: "editprofile") portion of your code seems wrong.

In the images you showed, nothing has the identifier of "editprofile". I would change that to "Settings", as it seems like that is your segue's identifier.

您的故事板 ID 区分大小写,请确保您在界面构建器中输入的任何内容,因为您的故事板 ID 与您在 swift 文件中以编程方式输入的内容相同且大小写相同

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