Eject icon indicating copy to clipboard operation
Eject copied to clipboard

Add support for Storyboard segues

Open KingOfBrian opened this issue 9 years ago • 1 comments

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

KingOfBrian avatar Nov 12 '16 16:11 KingOfBrian

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.

KingOfBrian avatar Nov 30 '16 01:11 KingOfBrian