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

  • Home
  • SEARCH
  • 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 6730917
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T10:27:58+00:00 2026-05-26T10:27:58+00:00

I am using this code to transition from the current view to another and

  • 0

I am using this code to transition from the current view to another and it works. The problem is that when I try to return to the current view the app crashes.

This is the code I use to pass from the current view to the new one:

CATransition *transition = [CATransition animation];

transition.duration = 0.75;
// using the ease in/out timing function
transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];

transition.type = kCATransitionReveal;

transition.subtype = kCATransitionFromRight;

transition.delegate = self;

// Next add it to the containerView's layer. This will perform the transition based on how we change its contents.
[self.view.layer addAnimation:transition forKey:nil];

// Here we hide view1, and show view2, which will cause Core Animation to animate view1 away and view2 in.

self.view.hidden = YES;

MyMessages *info1=[[MyMessages alloc] initWithNibName:@"MyMessages" bundle:nil];
[self.view addSubview:info1.view];

info1.view.hidden = NO;
self.view.hidden = NO;

I try to return using this code:

CATransition *transition = [CATransition animation];

transition.duration = 0.75;
// using the ease in/out timing function
transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];

transition.type = kCATransitionReveal;

transition.subtype = kCATransitionFromLeft;

transition.delegate = self;

// Next add it to the containerView's layer. This will perform the transition based on how we change its contents.
[self.view.layer addAnimation:transition forKey:nil];

// Here we hide view1, and show view2, which will cause Core Animation to animate view1 away and view2 in.
self.view.hidden = YES;

FirstViewController *info1=[[  FirstViewController alloc] initWithNibName:@"FirstViewController" bundle:nil];
[self.view addSubview:info1.view];

info1.view.hidden = NO;
self.view.hidden = NO;
  • 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-05-26T10:27:59+00:00Added an answer on May 26, 2026 at 10:27 am

    This is the code that needed to make the transition between an UIView of a UITabBarController and a new UIView. The code goes to a button’s IBAction which exists in one of the UIViews of the UITabBarController.

    //initialize the app delegate
    
    AppDelegate appDelegate = (AppDelegate) [[UIApplication sharedApplication] delegate];
    
    // get the view that's currently showing
    
    UIView *currentView = self.view;
    
    // get the the underlying UIWindow, or the view containing the current view view
    
    UIView *theWindow = [currentView superview];
    // remove the current view and replace with mynewView1
    [currentView removeFromSuperview];
    
    //assign the new view to the viewcontroller1. It is the first uiviewcontroller of the uitabbarcontroller. My uitabbarcontroller consists of five uiviewcontrollers in my project. The button exists in the first viewcontroller1 this is why i am assigning the new view to the viewcontroller1. If the button was pressed from the secondviewcontroller (viewcontroller2) of my uitabbarcontroller i will assign the new view to the secondviewcontroller (viewcontroller2) and so on...
    appDelegate.viewController1=[[MyMessages alloc] initWithNibName:@"MyMessages" bundle:nil];
    
    //add it to the window
    [theWindow addSubview:appDelegate.viewController1.view];
    
    // set up an animation for the transition between the views
    CATransition *animation = [CATransition animation];
    [animation setDuration:0.5];
    [animation setType:kCATransitionPush];
    [animation setSubtype:kCATransitionFromRight];
    [animation setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]];
    
    [[theWindow layer] addAnimation:animation forKey:@"SwitchToView1"];
    

    Thanks for you help! I have been trying this for more than a day to achieve it. I hope it will help someone with the same problem.

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

Sidebar

Related Questions

I am using this code to flip my view. but the problem is when
Using this code to zip a folder and it works perfect on small files
When using this code (simplified for asking): var rows1 = (from t1 in db.TABLE1
I'm using this code, and I get the stack trace that is listed below.
I'm using this code from Microsoft to play audio notifications for my application. It's
I am trying to use activity transition animaition using OverridePendingTransition The same code works
Sorry, lots of code coming up.. I saw another question like this that used
I am using this code in my view: @(Html.Telerik().TreeView() .Name(AjaxTreeView) .BindTo(Model, (item, category) =>
Im using this code for mysql connection $con = mysql_connect(localhost:/var/lib/mysql/mysql.sock, abc , xyz); if
While using this code to serialize an object: public object Clone() { var serializer

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.