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
6
votes
2 answers

iOS Disable popping to root view on pressing tab bar button

I'm looking to disable the functionality of pressing my tab bar and returning to the root view in the navigation hierarchy whilst also keeping this functionality for a button in my navigation bar. So the only way I want the user to go back to the…
6
votes
2 answers

Modal View Controller, dismiss and pop back to view controller

Im trying to dismiss a ModaViewController called C, back to A. The ModalViewController is presented in B. Therefore the Navigation flow is A->B - (present ModalView) -> C. I am able to dismiss the ModalViewController back to B, but I am unable to…
DevC
  • 6,606
  • 9
  • 40
  • 80
5
votes
3 answers

[self.navigationController popToViewController:VC2 animated:NO]; crash

Hi I am developing an application in which I supposed to go: From UIViewController1 to UIViewController2 From UIViewController2 to UIViewController3 From UIViewController3 to UIViewController4 From UIViewController4 back to UIViewController2 I am…
3
votes
3 answers

Swift 3: popToViewController not working

In my app I have three table view controllers and then potentially many UIViewControllers each of which has to lead back to the first table view controller if the user presses back at any point. I don't want the user to have to back through…
Filipe
  • 127
  • 3
  • 11
3
votes
2 answers

pass variable value by popToViewController in swift

I have a variable "NameofCircle" on LocationVC ViewController and i have variable CName on this Controller i want to pass the CName value to LocationVC Controller by popToViewController. I tried below code but did not get the result. let…
3
votes
3 answers

Pass Data using popToRootViewController

So I have a basic app, here is how it works. I have a root view controller called A and a table view controller called B. And when the user selects a row in B I pop back to the root view controller A. And what I am trying to do is to pass the data…
user3662854
3
votes
1 answer

Warning: Attempt to dismiss from view controller while a presentation or dismiss is in progress

In my Application what i'm doing is: rootViewController -> pushViewController -> pushViewController -> pushViewController -> presentModalViewController From presentModalViewController i want to go to rootViewController Directly. So what i did is…
3
votes
1 answer

When using popToRootViewController I lose my navigation bar

I have an iOS app where the main screen is a UICollectionViewController. When selecting an Item from the collection view the view is pushed to a detail view of the item. In the detail view I built a drawer/slider that moves out from the side. In…
Ben
  • 937
  • 3
  • 9
  • 23
2
votes
2 answers

iOS: popToRootViewController for presentViewControllers architecture

I know that I can use popToRootViewController if I have navigationController in my project but my whole project is based on presentViewControllers and there is a scenario where I am navigating to multiple levels. If there is only one level I can get…
AlienMonkeyCoder
  • 7,314
  • 11
  • 69
  • 138
2
votes
2 answers

How to come parent viewcontroller from child viewcontroller by using scrolling action?

I have two UIViewController named as ViewControllerA and ViewControllerB. ViewControllerA is the parent class and ViewControllerB is a child class, it is view by [self.navigationController pushViewController:viewControllerB animated:YES]; from…
Yuvaraj.M
  • 9,601
  • 16
  • 69
  • 98
2
votes
1 answer

popViewControllerAnimated animation not working in iOS5

Trying to back to previous viewController, but animation in iOS5 not working. - (IBAction)backToPreviousController { [self.navigationController popViewControllerAnimated:YES]; } Can somebody help me?
2
votes
0 answers

Pop back segue to Main(root) Viewcontroller doesn't work

I have Navigation Controller and 2 Viewcontrollers: MainVC(root) and SearchVC. Here is the hierarchy: First of all I'm using this transition function from MainVC ("+" navigation item) to SearchVC: @objc func goToSearchVC() { let…
Rurom
  • 243
  • 3
  • 16
2
votes
1 answer

How to properly use popToViewController?

What I am trying to do, is to pop all previous view controllers from the stack up to the 'menu' controller. I have a piece of code that is supposed to do that, but when 'menu' is clicked, the app crashes. The reason for the crash: 'Tried to pop to…
2
votes
0 answers

How to cancel PresentViewController animation

I have viewController1 (in a UINavigationController)that presents viewController2 The problem is that while the viewController2 is being presented (takes about 0.2s), an event in the app can cause viewController1 to be popped. Then I get: unbalanced…
Bbx
  • 2,622
  • 3
  • 18
  • 27
2
votes
1 answer

popToRootViewControllerAnimated causing a crash when ARC enabled

I have a non-arc project. Within my project, I have enabled arc in a few ViewControllers using -fobjc-arc. If I call popToRootViewControllerAnimated from an arc enabled VC, I get a crash.. If I remove arc from that VC, then…
1
2 3 4 5 6