15
13

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

UILabelのコンテンツをアニメーションする方法

15
Last updated at Posted at 2013-10-31

UILabelのコンテンツ(textやtextColorなど)をアニメーションさせたい場合は、CATransactionを使うと簡単に出来る。
これはUIButton.titleLabelなども同様。

 CATransition *fadeAnim = [CATransition animation];
 [fadeAnim setType:kCATransitionFade];
 [fadeAnim setDuration:0.7f];
 [_button.titleLabel.layer addAnimation:fadeAnim forKey:nil];
    
 _button.titleLabel.textColor = [UIColor redColor];
 _button.titleLabel.text = @"New Title";
15
13
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
15
13

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?