Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Storyboard segues #15

Open
KingOfBrian opened this issue Nov 12, 2016 · 1 comment
Open

Add support for Storyboard segues #15

KingOfBrian opened this issue Nov 12, 2016 · 1 comment

Comments

@KingOfBrian
Copy link
Contributor

If anyone has opinions on how to generate code for segues, please reply here!

@KingOfBrian
Copy link
Contributor Author

I think segue's can be turned into functions pretty cleanly. It won't work perfectly because it doesn't integrate with prepareSegue, but it will provide a nice migration path. So this:

<segue destination="mEm-Ej-dA4" kind="show" identifier="mainToSignInSegue" action="showDetailViewController:_:" id="dBg-ZI-lpi"/>
<segue destination="57h-AR-p0t" kind="show" identifier="mainToHomeSegue" id="YAY-rF-u8B"/>
func mainToSignInSegue() {
    let destination = ClassOfDetinationIDViewController()
    showDetailViewController(destination, sender: self)
}

func mainToHomeSegue() {
    let destination = ClassOfDetinationIDViewController()
    navigationController?.pushViewController(destination, animated: true)
}

If you know of any other segue attributes, add them here. I think there will just be a few function styles.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant