淡入淡出

158 阅读1分钟
#import "LGTestViewController.h"

@interface LGTestViewController ()

@property(nonatomic, strong) UIImageView *logoImageView;

@end

@implementation LGTestViewController


- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.logoImageView = [[UIImageView alloc] init];
    self.logoImageView.backgroundColor = [UIColor redColor];
    self.logoImageView.frame = CGRectMake(100, 100, 200, 100);
    [self.view addSubview:self.logoImageView];
}

- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {
    [UIView animateWithDuration:1.0 delay:0 options:UIViewAnimationOptionCurveEaseOut animations:^{
        self.logoImageView.backgroundColor = [UIColor orangeColor];
    } completion:nil];
}

@end