CAKeyframeAnimation *animation = [CAKeyframeAnimation animationWithKeyPath:@"contents"];
...
animation.repeatCount = loopCount == 0 ? 0 : loopCount; // <-- fix for single play gif from joshbedo
animation.fillMode = @"forwards"; // <-- insert this line to prevent the image disappearing after animation