Questions tagged [rootviewcontroller]
145 questions
1
vote
0 answers
Swift 3 - AppDelegate - RootViewController
I have a problem in my AppDelegate function didFinishLaunchingWithOptions
I use the SnapSwipeView https://github.com/jakespracher/Snapchat-Swipe-View to control my 'Camera' ViewControler in my AppDelegate and the if statement to know if the user is…

Bonilla
- 99
- 2
- 11
1
vote
1 answer
Setting rootViewController causes black screen blink before is loaded
I got strange behaviour when setting the rootViewController programatically. I am using xib's only and here are scenarios of what I already tried.
When I use this code, there is a small blink of black screen before it loads VC correctly.
-…

Jozef Vrana
- 309
- 1
- 5
- 14
1
vote
1 answer
What do the dashed lines represent in this image from the View Controller Programming Guide?
I'm reading from Apple's View Controller Programming Guide and I'm attempting to understand the idea of what the root view controller object is. The diagram below somewhat makes sense so the part that doesn't is trying to figure out what the dashed…

Laurence Wingo
- 3,912
- 7
- 33
- 61
1
vote
1 answer
How to present login screen only when a userdefaults key doesn't exist?
I am trying to develop an application (still learning) where i present a logon screen which takes a username and password - this then goes off to a web service to authenticate and returns an access token.
The access token is then stored in…

Michael
- 1,769
- 2
- 12
- 21
1
vote
1 answer
iOS 10 Swift 3 UIViewController present doesn't work
I'm currently developing an application using iOS 10 and Swift 3
I think that I may have destroy the navigation between my controllers.
Indeed, when I try to present a new view controller, I have this warning on Xcode debugger.
Warning: Attempt to…

Napsters Desmars
- 772
- 2
- 7
- 25
1
vote
3 answers
self.window.rootViewController.presentedViewController returning nil
self.window.rootViewController.presentedViewController
always returning nil though there is viewController available.
Not sure what i am doing wrong.
Below is the full code-
- (UIInterfaceOrientationMask)application:(UIApplication *)application…

iosDev
- 604
- 3
- 12
- 28
1
vote
0 answers
rootViewController conflicting with navigation controller
So I am doing this tutorial on how to create your own slide-out menu:
https://www.raywenderlich.com/78568/create-slide-out-navigation-panel-swift
The tutorial states that the view controllers can be swapped out for your own. So I incorporated it…

DG7
- 161
- 3
- 15
1
vote
2 answers
Root View Controller and unwind segues?
I have 3 View Controllers:
1) LoginViewController.
2) MainViewController.
3) LogoutViewController.
I am using NSUserDefaults to store the username when he login from LoginViewController.
Then in the AppDelegate I use this method:
self.window =…

FamousMaxy
- 686
- 5
- 21
1
vote
1 answer
Go back to original Root View Controller from a third tier Navigation Controller
I have some storyboards setup as below:
Storyboard A
--> Root Navigation Controller --> Container View Controller --> View Controller --> Home View Controller --> Storyboard B Reference
Storyboard B
--> Container View Controller --> Navigation…

Hodson
- 3,438
- 1
- 23
- 51
1
vote
0 answers
What is the difference between window.rootviewControoler VS [UINavigationController alloc] initWithRootViewController
What is the difference between these two kinds of View Controller?window.rootviewControoler VS [UINavigationController alloc] initWithRootViewController? I can't see window.rootviewcontroller in the stack trace.

Developer
- 6,375
- 12
- 58
- 92
0
votes
1 answer
How do i set/change the Root ViewController as a UINavigationController when the user opens the app a second time in swift?
i have an app where the user sets a username in the WelcomeViewController the first time he launches the app. This Username gets stored in Firestore. I want to change the ViewController that gets displayed when the app is opened after the username…

flolopi
- 43
- 6
0
votes
2 answers
viewWillAppear not being called after popToRootViewController
This is the flow:
VC1 ->(PUSH)-> VC2 ->(PUSH) -> VC3
When clicking a button in VC3 I am calling the method below and it works properly - taking me back to VC1:
self.navigationController?.popToRootViewController(animated: false)
But the problem is…

stackich
- 3,607
- 3
- 17
- 41
0
votes
1 answer
If i logout and login then unable to login for the first time, why? in swift
my app flow like below
uinavigationcontroller(is initial viewcontroller) -> loginVC -> homeVC
i am having SceneDelegate in project, so trying code like below
SceneDelegate code:
func…

Swift
- 1,074
- 12
- 46
0
votes
2 answers
(Objective-C) Difference between accessing the navigation stack through the window.rootView and keyWindow
Does anyone know what the difference is between
TabBarController* tabBar = (TabBarController *)_window.rootViewController;
UINavigationController* navigationController = tabBar.selectedViewController;
ViewController* initialViewController =…

valeriana
- 161
- 1
- 16
0
votes
1 answer
When should I set rootViewController? it's very confused
Hi I am struggling with rootViewController I left some code fragment with an explanation below, please let me know.
If I do it like below, it works and every things fine.
private func presentLogin() {
log.info("presenting login..")
…

yongwoo
- 65
- 1
- 1
- 7