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 8471611
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T16:50:37+00:00 2026-06-10T16:50:37+00:00

I feel like I’m missing something obvious. I’ve got a custom segue class. It

  • 0

I feel like I’m missing something obvious.

I’ve got a custom segue class. It does some animation. It works just fine if the current orientation is the same as the nib’s orientation, but I can’t make it work if the current orientation doesn’t match the nib (ie current orientation is landscape but nib is portrait).

The issue is that the destination view controller’s frame and orientation is wrong until viewDidAppear. But viewDidAppear is too late. Any attempt to do animation inside the custom segue must happen before viewDidAppear.

Oddly, viewDidLoad and viewWillAppear report the correct self.interfaceOrientation (while unfortunately reporting the wrong frame), but any attempt to draw in these methods will draw at the wrong orientation.

Anyone want to call me an idiot and point out the obvious mistake I’m making? I would greatly appreciate.

  • 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-10T16:50:38+00:00Added an answer on June 10, 2026 at 4:50 pm

    To answer my own question, I ultimately gave up on custom segues and opted for using a custom container controller. This doesn’t get around the problem of view controllers not knowing their proper frame until after appearing, but did simplify the problem.

    A more direct answer to my question is that it’s the responsibility of the container controller (or presenting controller) to change the presented controller’s frame. And the “best” way to do that, I’ve found, is to use the presenting/container controller’s bounds as a starting point. The presenting/container’s frame won’t accurately reflect changes in orientation.

    As an example in code, from my custom container controller:

    - (void)slideToEdit {
    
      // add edit to container and prep home for removal from container
      [self.home willMoveToParentViewController:nil];
      [self addChildViewController:self.edit];
    
      // the vital frame setting <- this is the bit that solves the problem
      self.edit.view.frame = self.view.bounds;
    
      // prep the animation
      __block CGRect frame = self.edit.view.frame;
      frame.origin.x += frame.size.width;
      self.edit.view.frame = frame;
    
      // animate
      [self transitionFromViewController:self.home toViewController:self.edit
        duration:SLIDE_SPEED options:UIViewAnimationCurveLinear animations:^{
    
        // slide animation
        frame.origin.x -= frame.size.width;
        self.edit.view.frame = frame;
    
      } completion:^(BOOL done) {
        [self.home.view removeFromSuperview];
    
        // finalise container heirarchy
        [self.home removeFromParentViewController];
        [self.edit didMoveToParentViewController:self];
      }];
    }
    

    This doesn’t feel ideal, in that having to manually modify the frame seems wrong when it could be inferred from the nib + current orientation. But this at least works.

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

Sidebar

Related Questions

I feel like I'm missing something obvious... but does firebug interfere with cookie deletion?
I feel like I'm missing something obvious, but I can't work out why my
I feel like I'm missing something very obvious here, but I can't get a
I feel like I'm missing something blindingly obvious here, so low hanging fruit for
I feel like there is something obvious I'm missing here. I am trying to
I feel like this is something I should already know, but I'm just not
I feel like there's something rather basic I'm missing here, which I previously thought
I feel like I am just missing a simple property, but can you set
I feel like I am missing something very simple here, but this is the
Feel like I'm overlooking the obvious here... I've got several vars set up like

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.