- (void)viewDidLoad {
[super viewDidLoad];
NSArray * imageList = @[@"Googleplus",@"Twitter",];
UIImageView * imageView = [[UIImageView alloc]initWithFrame:CGRectMake(20, 20, 100, 100)];
imageView.backgroundColor = UIColor.redColor;
[self.view addSubview:imageView];
imageView.image = [UIImage imageNamed:imageList.firstObject];
[imageView addObserver:self forKeyPath:@"transform" options:NSKeyValueObservingOptionNew context:nil];
CABasicAnimation * rotationAnim = [CABasicAnimation animKeyPath:kTransformRotationY duration:2 fromValue:@0 toValue:@(2*M_PI) autoreverses:NO repeatCount:CGFLOAT_MAX];
rotationAnim.delegate = self;
[imageView.layer addAnimation:rotationAnim forKey:nil];
}
-(void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary<NSKeyValueChangeKey,id> *)change context:(void *)context{
NSLog(@"%@",change);
}