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

Storyboard without Storyboard ID does not extend StoryboardScene #36

Closed
jakecraige opened this issue Oct 16, 2015 · 3 comments
Closed

Comments

@jakecraige
Copy link

When a storyboard does not have any IDs for it's scenes you cannot use the initialViewController method from StoryboardScene because the enum doesn't extend it.

It generates code like:

extension UIStoryboard {
    struct Scene {
        enum Main {
            static let storyboardName = "Main"
        }
    }
}

I've toyed around with manually trying to get it to work and have been unsuccessful. Because of the RawRepresentable requirement on the StoryboardScene protocol you can't have this enum use it since there are no cases.

@AliSoftware
Copy link
Collaborator

Ha, good catch.

Maybe we can provide the func storyboard() and func initialViewController() default implementations in an unbound extension StoryboardScene, and use the extension StoryboardScene where Self.RawValue == String only for func viewController() and static func viewController()?

@AliSoftware
Copy link
Collaborator

Now that #24 is fixed and that SwiftGen now uses templates, it should be very easy to make a PR to fix this!

@AliSoftware AliSoftware modified the milestone: 0.7.0 Oct 25, 2015
AliSoftware added a commit that referenced this issue Nov 4, 2015
AliSoftware added a commit that referenced this issue Nov 4, 2015
@jakecraige
Copy link
Author

Awesome! Thanks for fixing this.

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

2 participants