我正在尝试对一个标签执行动画,其中会发生翻转动画,并且在完成后经过一段时间后标签的文本会更改。但似乎延迟永远不会发生。尽管我在完成块中使用了
UIView animateWithDuration:0.5
delay:4.0 ,但文本立即更改。如果我在 completion block
中使用带有延迟的 performSelector
(注释语句),那么它会按预期工作。有什么想法为什么延迟值被忽略了吗?- (void) flipShapeWithText:(NSString *)text {
[UIView transitionWithView:someLabel duration:0.15 options:UIViewAnimationOptionTransitionFlipFromLeft animations:^{
someLabel.text = text;
}completion:^ (BOOL finished){
// [self performSelector:@selector(updateLabelText:) withObject: @"New Text" afterDelay:4.0];
[UIView animateWithDuration:0.5
delay:4.0
options: UIViewAnimationOptionTransitionCrossDissolve
animations:^{
currentShapeNameLabel.text = @"New Text" ;}
completion:nil];
}];
}