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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T05:42:58+00:00 2026-06-07T05:42:58+00:00

I was using a nice method to dismiss my modal view controller: [self dismissModalViewControllerWithTransition:2];

  • 0

I was using a nice method to dismiss my modal view controller:

[self dismissModalViewControllerWithTransition:2];

which makes a slide transition from left to right, like a navigation controller does to pop a view.

As this method is a non-public method, apple will not accept it. How can I program this kind of animation in my code (slide from left to right, to dismiss a modal view, and slide from right to left to present a modal view) ?

Thanks in advance

  • 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-07T05:42:59+00:00Added an answer on June 7, 2026 at 5:42 am

    I have accepted the answer from Safecase, but I would like to publish my final solution here:

    1) To present a modal view controller with a from right to left transition I have written following method:

    -(void) presentModalView:(UIViewController *)controller {
        CATransition *transition = [CATransition animation];
        transition.duration = 0.35;
        transition.timingFunction =
        [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
        transition.type = kCATransitionMoveIn;
        transition.subtype = kCATransitionFromRight;
    
        // NSLog(@"%s: self.view.window=%@", _func_, self.view.window);
        UIView *containerView = self.view.window;
        [containerView.layer addAnimation:transition forKey:nil];
        [self presentModalViewController:controller animated:NO];
    }
    

    2) To dismiss a modal view with an slide transition left to right:

    -(void) dismissMe {
        CATransition *transition = [CATransition animation];
        transition.duration = 0.35;
        transition.timingFunction =
        [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
        transition.type = kCATransitionMoveIn;
        transition.subtype = kCATransitionFromLeft;
    
        // NSLog(@"%s: controller.view.window=%@", _func_, controller.view.window);
        UIView *containerView = self.view.window;
        [containerView.layer addAnimation:transition forKey:nil];
    
        [self dismissModalViewControllerAnimated:NO];
    }
    

    Thanks guys!

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

Sidebar

Related Questions

I'm using the very nice PhotoSlider script from http://opiefoto.com/articles/photoslider to create a slide show
Im using libxml2 on the iPhone with the nice Method: PerformXMLXPathQuery from Cocoa with
I'm using the Apache BeanUtils setProperty method to import data from an Excel file
Is it possible to return an IOrderedEnumerable<T> from a method without using the OrderBy
I'm using the secret hidden ShellFolder class in Java. It has a nice method
Quoting from this nice article , The new view scope should solve exactly those
I am using some non-public method to better control the slide effects of my
I am using nice little piece of xstream to perform serialization. I have the
I've been using a nice, elegant plugin called DropKick for my webapp http://jamielottering.github.com/DropKick/ ,
So I rewrote my paths to something like: URL/really/nice/paths/ using mod_rewrite rules like this:

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.