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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T00:57:13+00:00 2026-06-18T00:57:13+00:00

Im writing a custom view controller container as per the iOS documentation on view

  • 0

Im writing a custom view controller container as per the iOS documentation on view controllers and i’m struggling on finding an elegant way to present the first view controller that also forwards the relevant display messages like viewWillAppear: automatically.

When i try transitionFromViewController:toViewController:duration:options:animations:completion: with the fromViewController: as nil i get an error. I have resorted to animating the view into the view hierarchy with a UIView animation block. This seems to break the automatic forwarding of the appearance methods and means its my responsibility to call viewWillAppear: and ViewDidAppear: at the appropriate times. Is there a more efficient way to transition the first view on to the screen that takes care of the appearance and rotation methods?

My code looks a little like this for animating in the first view controller.

self.visibleViewController = [[UIViewController alloc] init];
[self addChildViewController:self.visibleViewController];

[self.visibleViewController viewWillAppear:YES];
[self.visibleViewController.view setAlpha:0];
[self.view addSubview:self.visibleViewController.view];

[UIView animateWithDuration:0.5 
                      delay:0 
                    options:UIViewAnimationOptionCurveEaseOut 
                 animations:^{
                     self.visibleViewController.view.alpha = 1;
                 }
                 completion:^(BOOL finished){
                     [self.visibleViewController viewDidAppear];
                     [self.visibleViewController didMoveToParentViewController:self];
                 }];
  • 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-18T00:57:14+00:00Added an answer on June 18, 2026 at 12:57 am

    The answer was right there hidden in the documentation all along.

    The documentation for UIViewController is

    - (void)beginAppearanceTransition:(BOOL)isAppearing animated:(BOOL)animated

    and the companion

    - (void)endAppearanceTransition

    Their documentation says never to call viewWillAppear and such from your own code. You can kick the chain off properly with these methods.

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

Sidebar

Related Questions

I'm writing a custom annotation view for my latest iOS 5 app and I'm
I was writing a simple custom View Controller in ios5 with a UIScrollView and
I am writing an audio player for OSX. One view is a custom view
I'm writing an iPhone app. Starting from a view controller in a navigation stack
In ASP.NET MVC 2 project, how might I go about writing a custom view
I'm writing my own custom alert view for an application. The customer has their
I am writing a custom view that animates. Would it be better for the
I'm writing a custom view that needs to accept folder drops. The condition is:
I'm writing a custom view that directly extends android.view.View . If I try to
I'm writing on a custom view in android. It uses some png's, provided as

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.