Currently, I figured out how to animate an image that is in my UIViewController:
UIImage *image = [UIImage imageNamed:@"Logo.png"];
CALayer *logoLayer = [CALayer layer];
logoLayer.bounds = CGRectMake(0, 0, image.size.width, image.size.height);
logoLayer.position = CGPointMake(300, 216);
logoLayer.contents = (id)image.CGImage;
CAKeyframeAnimation *moveAnimation = [CAKeyframeAnimation animationWithKeyPath:@"position"];
moveAnimation.path = path.CGPath;
moveAnimation.duration = 2.0f;
[logoLayer addAnimation:moveAnimation forKey:@"moveAnimation"];
CAAnimationGroup *animationGroup = [CAAnimationGroup animation];
animationGroup.duration = 2.0f;
animationGroup.autoreverses = NO;
animationGroup.repeatCount = 1; //HUGE_VALF
[animationGroup setAnimations:[NSArray arrayWithObjects: moveAnimation, nil]];
[logoLayer addAnimation:animationGroup forKey:@"animationGroup"];
But this is based on a logoLayer, which is an image. How could I animate something like this but for a UIView? Such as a UIButton?