Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9070377
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T17:40:27+00:00 2026-06-16T17:40:27+00:00

I have a big application with many transitions in it using storyboard. The transitions

  • 0

I have a big application with many transitions in it using storyboard.
The transitions should be from right to left so I made a custom segue to perform it.

When I use the regular transition, each view controller I push into the navigation stack is being retained until I pop it.

While using custom segues doesn’t retain the previous controller (the one who push the current controller) and when I pop back, the instance of the controller gets a different memory address, which indicates that the pointer had changed.

This is the custom push segue:

UIViewController *sourceViewController = (UIViewController*)[self         sourceViewController];
UIViewController *destinationController = (UIViewController*)[self   destinationViewController];

CATransition* transition = [CATransition animation];
transition.duration = .3f;
transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear];
transition.type = kCATransitionPush;
transition.subtype = kCATransitionFromLeft;

[sourceViewController.navigationController.view.layer addAnimation:transition
                                                            forKey:kCATransition];

[sourceViewController.navigationController pushViewController:destinationController animated:NO];

and the custom pop segue:

UIViewController *sourceViewController = (UIViewController*)[self sourceViewController];
UIViewController *destinationController = (UIViewController*)[self destinationViewController];

CATransition* transition = [CATransition animation];
transition.duration = .3f;
transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear];
transition.type = kCATransitionPush;
transition.subtype = kCATransitionFromRight;

[sourceViewController.navigationController.view.layer addAnimation:transition
                                                            forKey:kCATransition];

[sourceViewController.navigationController pushViewController:destinationController animated:NO];

I perform the the segue with this method:

[self performSegueWithIdentifier:@"SearchToMenu" sender:self];

Nothing seems to work and I haven’t found anything online.

If I need to provide more code examples, screenshots, etc, please let me know.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T17:40:28+00:00Added an answer on June 16, 2026 at 5:40 pm

    Your popViewController is pushing, not popping.

    This line:

     [sourceViewController.navigationController pushViewController:destinationController animated:NO];
    

    should be:

    [sourceViewController.navigationController popViewControllerAnimated:NO];
    

    Your custom segue does retain the previous controller. But the destinationController of a segue is always a freshly instantiated object. You noticed that you were getting a different memory address for the new controller, but if you check your [self.navigationController viewControllers] stack you will see that the original viewController was still there, three objects down on the stack. In this corrected version you will return to that instance of the viewContoller, as you intend.

    That’s why you should never use a standard push segue to navigate back to anywhere lower down on your stack. Although the Storyboard will suggest that this is what will happen, it’s illusory: your are just navigating ON to a new instance of the previous viewController’s class. It will look exactly like the previous one in it’s initial state, because it is using the same Storyboard layout.

    Yours is a good example case where it might be better not to use a segue at all. It is not only confusing at this point, but, when you are popping back, if you were to try to configure the “destinationViewController” in prepareForSegue it would have no effect on your popped-back-to viewController. You may also have noticed that the Storyboard gets messed up, as it loses track of which viewController is contained in which NavController. You lose the navBars and the ability to configure them at all (in the storyboard – they are still there in the app).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have made a chat application where the chat view is formed from many
Many applications have dialogs which have totally custom-looking dialogs, big fat tool-bars and non-rectangular
I have a big application with many textbox controls (about 300-400). I need to
I have a pretty big web application that I created last year using ASP.NET
I use c# and c++ builder, and have big application with many menus, buttons,
I have a simple application made using C#. Now how do I make it
I have inherited an big existing PHP application (website actually) that runs on Apache.
Suppose that you have a big Data Entry Web Application Like Microsoft CRM ,
I have a big text file (5Mb) that I use in my Android application.
I have a very strange situation. I´m working on a pretty big Java application

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.