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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T16:55:25+00:00 2026-06-15T16:55:25+00:00

I have an iPad app that is displaying a note (subclassed UILabel ) with

  • 0

I have an iPad app that is displaying a “note” (subclassed UILabel) with text on it. In order to navigate to the next note, I’d like it to slide it off the screen to the left while having the next one slide in from the right. I can get either animation to work, but not both at the same time.

Here’s the code in my controller:

- (void)slideOutLeft {
    // create the new note
    flSlidingNote *newNote = [[flSlidingNote alloc] init];
    newNote.text = @"blah blah";
    CGRect newFrame = CGRectMake(1000, 70, 637, 297); // off the right
    newNote.frame = newFrame;
    [self.view addSubview:newNote];

    // slide off the current one
    CGRect currentFrameEnd = noteLabel.frame; // noteLabel is the existing note
    currentFrameEnd.origin.x = 0 - noteLabel.frame.size.width; // off the left

    [UIView animateWithDuration:1.0 animations:^{
        noteLabel.frame = currentFrameEnd;
    } completion:nil];
}

noteLabel does not animate at all. If I comment out the addSubview:newNote part it does. I’m still relatively new at this, so it’s probably just something simple.

The problem happens whether newNote is animated or not (not animated in the code snippet).

  • 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-15T16:55:26+00:00Added an answer on June 15, 2026 at 4:55 pm

    You want to put the animation for both your views and the addSubview call for your new view in one animation block, like so:

      // layout the new label like the old, but 300px offscreen right 
      UILabel * newNote = [[UILabel alloc] initWithFrame:CGRectOffset(self.noteLabelView.frame, 300, 0)];
      newNote.text = @"NEW NOTE";
    
     [UIView animateWithDuration:2.0f
                           delay:0
                         options:UIViewAnimationCurveEaseInOut
                      animations:^{
                         // animate the old label left 300px to offscreen left
                         self.noteLabelView.center = CGPointMake(self.noteLabelView.center.x-300, self.noteLabelView.center.y);
                         // add the new label to the view hierarchy
                         [self.view addSubview:newNote];
                         // animate the new label left 300px into the old one's spot
                        newNote.center = CGPointMake(newNote.center.x-300, newNote.center.y);
                      }
                      completion:^(BOOL finished) {
                        // remove the old label from the view hierarchy
                        [self.noteLabelView removeFromSuperview];
                        // set the property to point to the new label
                        self.noteLabelView = newNote;
                   }];
    

    In this snippet above, I’m assuming the old label is addressable via the property self.noteLabelView.

    (Also have a look at https://github.com/algal/SlidingNotes , though I can’t promise that will stay there long so maybe SO isn’t the right format for such a link? )

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

Sidebar

Related Questions

I have an iPad app that I would like to make Universal, however this
I'm building an iPad app that will have multiple paper pages and I'd like
I have an iPad app that I would like to work in the sideways
I have an IBAction command in my iPad app that I would like to
I have an iPad app that uses custom fonts though the UIAppFonts elements in
I have an iPad app that has a UITableViewController that implements the NSFetchedResultsControllerDelegate .
I have this iPad app using Storyboard. There are some file that are marked
I know that after I have deployed my ipad/iphone app into App Store, it
I have an iPad 2 canvas app (game) and would like to get it
I have an iPad App that is 51.87MB in size. I am trying to

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.