Questions tagged [rootviewcontroller]
145 questions
1
vote
4 answers
Update root view controller after user login + iOS 13 and later
Using scene delegate I'm able to set the root view controller.(I'm using Xcode 11.3 and iOS version 13.3 and running my app on iPhone 6+ with iOS 12.4)
What I want is when user login, I need to update the root view controller. For that I did the…

Mahendra
- 8,448
- 3
- 33
- 56
1
vote
0 answers
Issue with loading view controller programmatically with app delegate
I am trying to load a view controller from the main storyboard programmatically from the app delegate. I am using Xcode 11.1 and Swift 5. Additionally, I have NOT designated main storyboard as the 'main interface' in deployment info and there is…

Golam Moinuddin
- 33
- 3
1
vote
0 answers
iPadOs 13.2 Beta NavigationController Crash
We have a live iPad application written in XCode 6.4 which runs fine on iPadOS 12, 13.1, 13.1.2 but crashes on iPadOS 13.2 Beta.
I have created a skeleton version of the application which does nothing except attempt to show a viewController via a…

simonearls
- 11
- 3
1
vote
2 answers
How do I remove a no longer needed view controller?
I am using my app delegate to transition between view controllers. When the delegate decides it no longer needs the view controller, based on messages from the server, it needs to remove the current view and replace it with another one. Currently…

George Johnston
- 31,652
- 27
- 127
- 172
1
vote
1 answer
iOS: UIWindow.rootViewController must be used from main thread only
I have a problem by using
if let wd = UIApplication.shared.delegate?.window {
var vc = wd!.rootViewController
If I put this piece of code in a Dispatch, the warning message disappear, but the application doesn't display…

ΩlostA
- 2,501
- 5
- 27
- 63
1
vote
3 answers
Issue on dismissing a viewController to rootViewController
I am trying to dismiss a viewController to rootViewController while signOut. But the problem is that the viewController is not getting dismissed, It still remains in the same page itself.
Below I have mentioned the code that I have used.
let…

Wide Angle Technology
- 1,184
- 1
- 8
- 28
1
vote
0 answers
Access to UITransitionView's From UIWindow
In my application I have a UINavigationController, After authentication I run perform segue(Push replace) for navigating to UINavigationController, when app goes to background I present Authentication page again, I do this in a classed I named it…

Hamed
- 1,678
- 18
- 30
1
vote
2 answers
viewDidLoad called twice, using navigation controller
My ViewDidLoad method on a ViewController is called twice, but only in a particular scenario. There are two view controllers which I need to present, one if user isn't logged in and the second if the user is logged in. I am using storyboard and have…

Sam
- 521
- 1
- 6
- 23
1
vote
1 answer
How to change the root view controller of a uinavigation controller embedded in a uitabbarcontroller?
Please see the attached image. Here I am having a uitabbarcontroller attached with navigation controller which is having a root view as the "first view". When I click on a button in the first view it goes to the "Second View".
At some point, I…

Chelsea Shawra
- 1,593
- 4
- 22
- 43
1
vote
0 answers
Why do my constraints all of a sudden break within a UINavigationController?
Placing my VC normally as self.window?.rootViewController = UITableViewVC() produces the expected result.
self.window = UIWindow(frame: UIScreen.main.bounds)
self.window?.backgroundColor = UIColor.darkGray
let nvc =…

Sebastian Dwornik
- 2,526
- 2
- 34
- 57
1
vote
1 answer
Swift 3D Touch Open TabBarController Not RootViewController
I'm currently trying to add 3D touch to my app. I've already achieved that my app shows the UIApplicationShortcutItems, but now I'm having trouble assigning an action to them.
This is my current code:
func application(_ application: UIApplication,…
user9052417
1
vote
4 answers
Dismissing a View Controller, then presenting an Alert Controller
In my project, I am using rootViewController?.dismiss to dismiss some View Controllers back to the main VC.
In the completion handler, I would like to present a UIAlertController on the main View Controller once it becomes visible again.
My problem…

Joe
- 3,772
- 3
- 33
- 64
1
vote
1 answer
Thread safe way to get currently displayed view controller
Currently I use this method to get the current view controller:
func topMostContoller()-> UIViewController?{
if !Thread.current.isMainThread{
logError(message: "ACCESSING TOP MOST CONTROLLER OUTSIDE OF MAIN THREAD")
return nil
…

boidkan
- 4,691
- 5
- 29
- 43
1
vote
1 answer
UnwindSegue from View Controller containing a TableView back to Root View Controller
How can I successfully unwind back to my Root View Controller? I am trying to use a button/nav bar item to return to previous Controller. I've seen a solution to use something like...
self.tabBarController?.selectedIndex = 1
but I sadly could not…

William
- 67
- 9
1
vote
1 answer
When change root view controller, initial view controller is displaying for one or half second
In the app FIRSTViewController is initial View Controller set from storyboard. Login, Register, etc option available there. Login screen is presented from it:
let destVC =…

GSL
- 23
- 4