I would like to have text that blinks using basic animation. I added the following code, but can't see the text not vibrate.
UILabel* labelText = [[UILabel alloc] initWithFrame:CGRectMake(355, 490, 400, 50)];
labelText.text = @"Tap to start";
labelText.backgroundColor = [UIColor clearColor];
[self.view addSubview:labelText];
void (^animationLabel) (void) = ^{
labelText.alpha = 1;
};
void (^completionLabel) (BOOL) = ^(BOOL f) {
labelText.alpha = 0;
};
NSUInteger opts = UIViewAnimationOptionAutoreverse | UIViewAnimationOptionRepeat;
[UIView animateWithDuration:1.f delay:0 options:opts
animations:animationLabel completion:completionLabel];
any idea? I really don't understand what's wrong with my approach.
source
share