Closed fabdurso closed 8 years ago
Have you tried self.navigationController
instead?
[self.navigationController presentViewController:onboardingVC animated:YES completion:nil];
stille the same :(
You put this code inside a view controller - what are you doing with the view controller itself? How/where do you create/show it.
ok so... I'm calling firstTimePopup
from my viewDidLoad
when the user launches the app for the first time. is there something else I should add?
I don't know enough about what you're doing. The view controller you showed the file for, is that being shown on screen?
The ViewController is my "homepage", that is showing correctly. Now on ViewController.m, in the viewDidLoad
I check if it's user first use and if so, I call firstTimePopup
, that should show the onboardingvc.
i know i'm missing something elementary but can't figure out what.
It sounds like a very simple issue - you're missing something somewhere. Have you tried presenting a normal UIViewController
instead of the onboarding view controller? Have you tried moving that code somewhere outside of viewDidLoad
, perhaps viewDidAppear
?
Yes, I called it from a button and it works! So should I move the code to viewDidAppear?
Sounds like your timing was bad - you never want to present a view controller in viewDidLoad
, as that can be called before that view controller is even shown on screen. I would suggest moving it to viewDidAppear, which will onboard slightly after the original view controller is seen.
I did it and it doesn't show up.
It shows up on button click, but not in viewDidAppear
?
exactly
That sounds really odd... Without looking at more of the code, setting my own breakpoints/logs, etc., I'm not sure I can help. Presenting a view controller is about as simple as it gets - but I don't really have enough info to debug remotely.
Ok so i found a way. Not move all the code to viewDidLoad
but just [self firstTimePopup]
.
It is working now.
And like a charm. Amazing job man! Thank you for the support!
No problem, glad to help!
I'd like to show Onboard at first time launch, but right now nothing appears. This is my code:
what am I missing?