Questions tagged [rootviewcontroller]

145 questions
0
votes
1 answer

Set NavigationBarController to rootViewController

I try to use MVC pattern, where my NavigationController instantiates and controls all my views and the corresponding view switches. To achieve this, I just instantiate my navigationController and set it as rootViewController in the app…
0
votes
1 answer

Is rootViewController always ready to present a segue by the time application:didBecomeActive is called (iOS)?

My app has a rootViewController setup in a storyboard. I originally asked this question, but I can see that it is the wrong question to ask now: Is the viewDidLoad method of the rootViewController always called before application:didBecomeActive…
SAHM
  • 4,078
  • 7
  • 41
  • 77
0
votes
2 answers

Adding a ViewController in front of window!.rootViewController of type UITabBarController Swift 4

I have inherited a storyboard that launched directly to a UITabBarController. In the AppDelegate.swift file in the didFinishLaunchingWithOptions method there is the following code: //let loginScreen = window!.rootViewController let tabController =…
Jacobi
  • 21
  • 1
  • 6
0
votes
2 answers

TableViewcontroller.xib created by me should be initial controller

I have created TableViewController by xib not on storyboard. I have view controller which loads by default. Now I want that TableViewController as root controller. Thanks in advance.
blackstorm
  • 60
  • 10
0
votes
1 answer

assigning a custom destination to popToRootViewController swift 4

I am using navigationController?.popToRootViewController(animated: true) to dismiss my current view to the previous view. My view controller relationship looks like this. VC1->VC2 VC1->VC3 VC3->VC2 Whenever the client is in VC2 I want to pop the…
chan
  • 21
  • 4
0
votes
0 answers

Swift - how to reference subview from AppDelegate

My root ViewController is called MainViewController. It has a subview called ToolsViewController. I want to reference the subview (ToolsViewController) from my AppDelegate. I can reference the root view, however, I cannot seem to get to the…
squarehippo10
  • 1,855
  • 1
  • 15
  • 45
0
votes
1 answer

Swift. NavigationController. Conditionally change the order of child viewControllers

If I have a storyboard with a navigationController with 2 child viewControllers (vcA and vcB) where vcA is set as the navigationController's root viewController and a storyboard segue connects vcA to vcB (vcA and vcB show alternate ways of viewing…
0
votes
1 answer

How to find out a tab bar controller inside a SlideMenuController swift?

I have implemented an EXSlideMenuController and added a TabBarController as a main view controller in the sliding menu controller but now I want to find out the first view controller of TabBarController which is inside the EXSlideMenuController. let…
0
votes
1 answer

trying to return to start: unrecognized selector sent to instance

After the results page, I want the user to press "done" and return to the first question on the list. At the moment, the app crashes with "unrecognized selector sent to instance. 2018-04-19 11:56:49.072392-0400 test[62142:269319]…
sheishistoric
  • 85
  • 1
  • 9
0
votes
1 answer

Tab bar disappeared when back to initial view controller

i have 2 view controllers then tab bar controller connected to 3 navigation controller , each navigation connected to multiple views . The point that from one of these views that is connected to one of navigation controllers , i want to back again…
0
votes
1 answer

iOS app returns to rootViewController when kept in background

My iOS app returns back to rootViewController when kept in background for longer time. To demonstrate I have the below picture I navigate all the way to ViewControllerC and keeps the app in background, when I returns to the app say after 30 mins,…
0
votes
4 answers

Setting root view controller is not working?

My code is #import "AppDelegate" in viewDidLoad self.delegate = (AppDelegate *) [[UIApplication sharedApplication] delegate]; After getting the response //If server response is success make HomeViewController as Root VC if ([[[_response…
0
votes
2 answers

Unit test when the rootViewController presents a view?

I'm trying to unit test a function which presents a view outside a viewController: public func presentInOwnWindow(animated: Bool, completion: (() -> Void)?) { let alertWindow = UIWindow(frame: UIScreen.main.bounds) …
SwiftyJD
  • 5,257
  • 7
  • 41
  • 92
0
votes
0 answers

iPad push view controller lags behind

I am doing a simple pushViewController(controller, animated: true) on my view controller on iPad: I am starting on ViewController A. I want to push viewController B on a button tap. I have a func buttonTapped( {…
Logan
  • 1,172
  • 9
  • 23
0
votes
0 answers

How to make a global function for push/pop decision for all viewcontrollers (vc, vc2, vc3, vc4..)

Can I make a global function for push/pop decision for all viewcontrollers (vc, vc2 ,vc3, vc4, ...)? func poprootviewcontroller(view: UIView?,title: String?,f: CGRect?)->UIButton { return btn like so?