Questions tagged [poptoviewcontroller]

popToViewController is method in UINavigationController class that is part of iOS SDK. By calling this method you pop view controllers until the specified view controller is at the top of the navigation stack.

The definition of method is next:

- (NSArray *)popToViewController:(UIViewController *)viewController animated:(BOOL)animated;

Parameters

  1. viewController: The view controller that you want to be at the top of the stack.

  2. animated: Set this value to YES to animate the transition. Pass NO if you are setting up a navigation controller before its view is displayed.

Return Value

An array containing the view controllers that were popped from the stack.

82 questions
0
votes
1 answer

Poping different viewcontroller using poptoviewcontroller

I have an application that contain three viewcontrollers Mapview is rootviewcontroller mapview -pushviewcontroller - listview, listview - pushviewcontroller - mapview, 1st conditon mapview -pushviewcontroller - cityview and cityview -…
0
votes
1 answer

UIKit: `popViewController` with completion block

I've been searching for a solution for this since yesterday. Everything I could find was suggested 4-5 iOS versions ago, and seems to not work anymore. I was wondering if anyone has a new, working idea? Adding the two different suggestions I…
Yotam
  • 9,789
  • 13
  • 47
  • 68
0
votes
1 answer

How to clear a textbox in view after calling popToViewController

I have a view (viewControllerA) that has a textbox. The user populates it and clicks Next. After completing a few steps, they're done/submit all data and I want to pop them back to viewControllerA, but when I do, the textbox is still populated. I…
btorkelson
  • 89
  • 2
  • 10
0
votes
1 answer

use popToRootViewController and pass Data

I'm applying for a junior developer position and I've got a very specific task, that already took me 3 days to complete. Sounds easy - pass data to rootViewController. That's what I've done: 1) private func userDefaultsToRootController() { …
0
votes
1 answer

How can I return to my previous controller using poptoviewcontroller

I have a 3 view controllers, A->B->C but between B and C I have a navigation controller. My C controller is getting some information from the user and I am saving it in Realm(local database). When exiting that controller I want to go to the B…
0
votes
2 answers

Go back multiple ViewControllers from NavigationController back button

I want to go back two ViewControllers rather than one when I click the back button on the NavigationController. override func viewWillDisappear(_ animated: Bool) { super.viewWillDisappear(animated) if self.isMovingFromParent …
iphaaw
  • 6,764
  • 11
  • 58
  • 83
0
votes
0 answers

PopToViewController with modals

I am currently experimenting with PopToViewController and noticed that if I have the following scenario I get null back from the method: Navigation Stack UIViewController1 - position 0 UIViewController2 UIViewController3 UIViewController4…
Robert
  • 61
  • 5
0
votes
2 answers

Transition to MainVC gives the empty View without subviews

I'm using this type of transition to UIViewcontroller: self.navigationController?.popToViewController(MainVC(), animated: false) And in result i want to receive the MainVC with all subviews... but i receive only empty main View without any…
Rurom
  • 253
  • 3
  • 18
0
votes
1 answer

App crash on pushViewController after popToViewController

I have tried to search for this, but can't find any perfect solution. My app has custom animating views and both side drawers.I also have custom navigationController which has sliding top bar.From appDelegate I'm setting first controller as…
0
votes
2 answers

popToViewController isn't popping all of the view controllers

So I have 3 view controllers: TableViewController, A, and B. The user is able to navigate to any view controller from any view controller. When the user goes back and forth between A, and B view controllers I want them to be pushed onto the nav.…
0
votes
3 answers

popToViewController life cycle

I'm working on iOS app and sometimes I need to jump on the second view of my application, but exactly on the state of the view I've left it. I've found out that popToViewController is suitable for this operation. My question is : What happens with…
j-zeff
  • 5
  • 4
0
votes
4 answers

Remove intermediate View Controllers from Navigation Stack - iOS

I have a navigation stack as following: VcA -> VcB -> VcC When I press the back button on VcC navigationBar, I want to go to VcA. I tried doing [self.navigationController popToRootViewControllerAnimated:YES] but it first pops to VcB and then goes to…
Hyder
  • 1,163
  • 2
  • 13
  • 37
0
votes
1 answer

How to fix a warning for UISearchController when navigating out of UITableView using popViewControllerAnimated(true)

The searchController is declared in viewDidLoad() of a TableViewController as searchController = UISearchController(searchResultsController: nil). When user selects a row in current table view, it navigates out to previous viewcontroller using…
0
votes
0 answers

Swift app crashes when popToRootViewController called - Exc Bad Access

My Swift app crashes when I have about 4 view controllers on my navigation stack and then at the 4th I call popToRootViewController. It pops, so I know the UINavigationController exists, but the app crashes without any error other than Exc Bad…
justColbs
  • 1,504
  • 2
  • 18
  • 28
0
votes
2 answers

Proper way to call popToViewController - iOS

I am having an argument with my team member regarding popToViewController. For me best approach is Can i pop to Specific ViewController? But he think we should create a static instance of the viewController and then…
Tariq
  • 9,861
  • 12
  • 62
  • 103