1

I have an image that I wish to animate after a view has appeared. I'm doing the following:

- (void)viewDidAppear:(BOOL)animated { [super viewDidAppear:animated]; CGRect folderFrame = self.folderImage.frame; folderFrame.origin.y += 250; [UIView animateWithDuration:250 animations:^{ self.folderImage.frame = folderFrame; }]; } 

But I can't see any animation. What am I doing wrong?

2 Answers 2

3

If this is the exact code you are using, then the problem might be that you have the animation set to take 250 seconds (about 4 minutes). Is it possible that it is animating, just very, very slowly?

Sign up to request clarification or add additional context in comments.

Comments

1

I think it is working, but moving 1 point per second, practically imperceptible. Try specifying a shorter duration for the animation.

2 Comments

Aha! I thought I was working with milliseconds for some reason. Rookie error. :)
Is there any specific reason why the same code (now with a sensible duration) wouldn't animate in viewWillDisappear as well?

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.