Skip to content
This repository has been archived by the owner on Sep 6, 2019. It is now read-only.

identifiers without custom view controllers are not generated #36

Open
Marwan-Al-Masri opened this issue Jun 9, 2015 · 1 comment
Open

Comments

@Marwan-Al-Masri
Copy link

some view controllers don't really need a custom class (at least in my case), so with your awesome script (which helped a lot), I can't get to those VCs without knowing their identifier by code.. wouldn't it be more helpful if you generate the "identifiers" of those VCs into an enum or smthn?

@phimage
Copy link
Collaborator

phimage commented Jun 19, 2015

The normal code generated if custom class is defined for the Segue is

extension ScreenThreeViewController {
    enum Segue: String, Printable, SegueProtocol {
       case ToChildOfThreeView = "ToChildOfThreeView"

Now by defining only a storyboardIdentifier on view controller, for the example 'ScreenThreeViewController' , we could generate

extension XXX {
    struct ScreenThreeViewController {
        enum Segue: String, Printable, SegueProtocol {
            case ToChildOfThreeView = "ToChildOfThreeView"

with XXX =

  • UIViewController => simple way without changing anything else, could have conflict name with multiple storyboards
  • or Storyboards.<Main:StoryboardName>.ViewControllers => with ViewControllers struct created into Storyboards.<Main:StoryboardName>

with this last choice, in bonus we can have Storyboards.Main.ViewControllers.ScreenThreeViewController.instantiate()

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

No branches or pull requests

3 participants