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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T06:52:29+00:00 2026-06-06T06:52:29+00:00

I am trying to do custom animations between view controllers and in the case

  • 0

I am trying to do custom animations between view controllers and in the case below I am doing a mimicking of UINavigationController’s popViewController. However, it seems to lag a lot on iPhones and especially iPads and Time Profiler confirms it saying that all of the lag comes from the addSubview line.

Anyway, I connect nlView via Interface Builder and I use the code below:

    [self.view.superview addSubview:nlView.view];
    [nlView.view setFrame:CGRectMake(-kWidth, 20, kWidth, kHeight-20)];
    [UIView animateWithDuration:2
                     animations:^{
                         [nlView.view setFrame:CGRectMake(0, 20, kWidth, kHeight-20)];
                         [self.view setFrame:CGRectMake(kWidth, 20, kWidth, kHeight-20)];
                     }
                     completion:^(BOOL finished){
                         [self.view removeFromSuperview];
                     }];

So, how could I minimize this lag to nothing at all? There are no leaks or anything like that but how could I just change my logic so that there is no lag when changing views?

Thanks!

  • 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-06T06:52:31+00:00Added an answer on June 6, 2026 at 6:52 am

    If you want to animate the view’s position then instead of setting the frame, animate the view’s layer position like this: [nlView.view.layer setPosition: newPosition]... of course you need to add QuartzCore to your project and import QuartzCore/QuartzCore.h

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

Sidebar

Related Questions

Context: I am trying to perform a custom animation from a normal UIViewController.view to
I'm trying to draw custom UI (a path in this case) on top of
I'm trying to animate a custom UIButton but my code doesn't seems to work.
I am trying to move some custom drawing code from a view into a
In an activity, I'm trying to make a custom transition between two Activities .
I'm trying to use custom meta boxes in wordpress. My goal at the moment
I'm trying to use custom check boxes within Fancybox. They are showing up but
I was trying to implement custom validation attribute by inheriting from ValidationAttribute and found
I'm trying to show custom posts that contain a meta variable that matches a
I am trying to add custom icons to a Shared Add-in for Microsoft Word.

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.