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

View controller as IBOutlet #192

Open
emil622 opened this issue Jun 22, 2017 · 3 comments
Open

View controller as IBOutlet #192

emil622 opened this issue Jun 22, 2017 · 3 comments

Comments

@emil622
Copy link

emil622 commented Jun 22, 2017

I see the template has an Initialiser class which has a View controller as IBOutlet property. How am I supposed to connect the VC as IBOutlet? I never did this and couldn't find someone who did it.

Any help will be appreciated, Thanks.

@piv199
Copy link

piv199 commented Jul 3, 2017

You could do it in xib, as far as I am concerned.

@ghost
Copy link

ghost commented Aug 12, 2017

When you're using storyboards you could add Object to the scene:

zrzut ekranu 2017-08-12 o 08 55 15

Then connect view controller from your initializer object to view controller in storyboard:

zrzut ekranu 2017-08-12 o 08 57 26

That should work.

@josmanperez
Copy link

Hi!,

I'm trying to launch a view controller from within AppDelegate, but I'm not able to do it yet. If I just instantiate the ViewController and added that to the rootViewController like:

window?.rootViewController = TestViewController()

I has an empty black screen (because It's not connected to the Storyboard), but if I use:

window?.rootViewController = TestModuleInitializer().testViewController

I got an exception:

*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Application windows are expected to have a root view controller at the end of application launch'

I'm very new to VIPER and I want to know how I could achieve launching a ViewController from the AppDelegate using the Storyboard and the ModuleInitializer.

Thank you :)

Regards

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

No branches or pull requests

3 participants