I am trying to animate a UILabel with a transform property. It seems to work fine in the main animation. But once I try animating in the main animations completion block
UILabel *dateLabel = [[UILabel alloc] initWithFrame:CGRectMake(point.x, point.y, 50, 20)];
dateLabel.text = [NSString stringWithFormat:@"%d", date];
dateLabel.textColor = [UIColor whiteColor];
dateLabel.textAlignment = NSTextAlignmentCenter;
[self addSubview:dateLabel];
[UIView animateWithDuration:.4 animations:^{
dateLabel.frame = CGRectMake(self.frame.size.width/2 - 25, 10, 50, 70);
self.calendar.frame = CGRectMake(0, 800, 320, 320);
dateLabel.font = [UIFont fontWithName:@"Bariol-Bold" size:28];
} completion:^(BOOL finished) {
[UIView animateWithDuration:.5 animations:^{
self.monthLabel.transform = CGAffineTransformMakeScale(1.2,1.2);
[self.monthLabel sizeToFit];
} completion:nil];
[UIView animateWithDuration:.5 animations:^{
self.monthLabel.transform = CGAffineTransformMakeScale(1.15,1.15);
[self.monthLabel sizeToFit];
} completion:nil];
calendarAnimation = NO;
}];
init
yourself.monthLabel
. – Unheilig