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

show Intro With Custom View From storyboard instead of Nib? #166

Open
oenama opened this issue May 14, 2016 · 3 comments
Open

show Intro With Custom View From storyboard instead of Nib? #166

oenama opened this issue May 14, 2016 · 3 comments

Comments

@oenama
Copy link

oenama commented May 14, 2016

is it possible to show Intro With Custom View From storyboard instead of Nib(xib file) ?

@ealeksandrov
Copy link
Owner

ealeksandrov commented May 19, 2016

It is not supported right now and not a short-term feature. But I am open to discussion and implementing it in future releases.

How do you want it to look? Storyboards can only store views inside ViewControllers.
One possible idea is to make EAIntroView as some sort of container with pages as child views.
http://stackoverflow.com/a/21946121/840588

@alejandroivan
Copy link

In theory, he could do it assigning an identifier to a view controller and then messaging the instantiateViewControllerWithIdentifier: method on a UIStoryboard instance. Something like:

#import "AppDelegate.h"
#import "EAIntroPage.h"

UIWindow *window = [(AppDelegate *)[[UIApplication sharedApplication] delegate] window];
UIStoryboard *storyboard = [[window rootViewController] storyboard];

UIViewController *newVC = [storyboard instantiateViewControllerWithIdentifier:@"SomeIdentifier"];
UIView *vcView = [newVC view];

EAIntroPage *page = [EAIntroPage pageWithCustomView:vcView];

I could be wrong, but I see no reason for this to fail.

@GabLeRoux
Copy link

I confirm the above solution does work.

On the other hand, I currently have troubles with Auto Layout and Constraints for theses views within the storyboard. Starting them manually displays them fine (ex: by setting the view as initial view controller). When I load them trough EAIntroPage, sometimes, positions are ok, sometimes they are not and the behaviour changes each time I showInView (display the introduction view, without leaving the app).

I may send a PR with examples if I get something working out of it.

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

4 participants