Tag: animation

UIView animateWithDuration returns immediately

I’m trying to animate a label embedded in a UIView. this is the code : -(void)displayText:(NSString*)text { [label setText:text]; [UIView animateWithDuration:5.0 delay:0.0 options:UIViewAnimationOptionCurveEaseIn animations:^{ [labelView setAlpha:1.0]; } completion:nil ]; [UIView animateWithDuration:5.8 delay:0.0 options:UIViewAnimationOptionCurveEaseIn animations:^{ [labelView setAlpha:0.0]; } completion:nil ]; } To verify, the method is called, i set a breakpoint. The calls return immediatly but […]

How can I animate zoom in / zoom out on iOS using Objective C?

I’m looking to replicate the zoom in / zoom out animations so common in iOS applications (example #1, #2). I am specifically looking for a source that can provide some common library with pre-specified values for ideal sort of animations. Like for zoom in, it should come with preconfigured transform values that are easily identifiable […]

Crash when using (animation) blocks in switch statements

This code works (if-statement with animations): // works if (_camOrientation == UIDeviceOrientationPortrait) { [UIView animateWithDuration:0.5f animations:^(void){ [_distanceView setTransform:CGAffineTransformMakeRotation(degreesToRadian(0.0))]; }]; } else if (_camOrientation == UIDeviceOrientationLandscapeLeft) { [UIView animateWithDuration:0.5f animations:^(void){ [_distanceView setTransform:CGAffineTransformMakeRotation(degreesToRadian(90.0))]; }]; } This also works (switch-statement without animations): // works switch (_camOrientation) { case UIDeviceOrientationPortrait: [_distanceView setTransform:CGAffineTransformMakeRotation(degreesToRadian(0.0))]; break; case UIDeviceOrientationLandscapeLeft: [_distanceView setTransform:CGAffineTransformMakeRotation(degreesToRadian(90.0))]; break; default: […]

Unwind with more than 1 segue using iOS 7 UIViewController transition animations

I am using the UIViewController animated transitions introduced in iOS7. I am able to produce some really great transitions going back and forth between VC’s using segues etc. Take a look at my picture below: I can very easily go back and forth if it is just one segue/vc at a time. For example if, […]

Typing while animation UITextView

I’m trying to have a variable-height UITextView which changes size to accomodate its contents, but when the frame changes in the size-change animation, one or two keystrokes aren’t captured in the UITextView. The animation duration is 0.1s, and typically it only misses one letter when you’re typing fairly fast. It is, however, very consistent in […]

Iphone Splash Screen

I am really trying to do my best but I can’t really find out what’s going wrong in my code. I made a lot of search but I guess I just can’t understand some objective c basics 😉 My first question is related to the code below : [window addSubview:tabBarController.view]; UIImage *image = [UIImage imageNamed:@”lol.png”]; […]

UILabel stops animations

I have 5 UIImageViews getting animated down the screen. If one is pressed, and it meets the requirements, it will add 1 to your score, using this: self.score.text = @(self.score.text.integerValue + 1).stringValue; But when the text in the UILabel updates, all the animations stop abruptly and the remaining UIImageViews disappear. But, the animation only restarts […]

Label display not instant with iPhone app

I am developing an application for the iPhone. The question I have is how to display a new label with a different text every .5 seconds. For example, it would display Blue, Red, Green, Orange and Purple; one right after one another. Right now I am doing this: results = aDictionary; NSArray *myKeys = [results […]

Is it possible to successful animate a moving UIButton?

I’m trying to animate a button which moves around the screen. At any point, the user can push the button. But the button doesn’t respond to touches. I’ve tried an animation block but the button simply moves immediately to its end coordinates, while the frame shows the animation (the button is called bubble): [UIView beginAnimations:nil […]

Change the speed of setContentOffset:animated:?

Is there a way to change the speed of the animation when scrolling a UITableView using setContentOffset:animated:? I want to scroll it to the top, but slowly. When I try the following, it causes the bottom few cells to disappear before the animation starts (specifically, the ones that won’t be visible when the scroll is […]