"transform") shake.values = [NSValue(caTransform3D: CATransform3DMakeTranslation(-6.0, 0.0, 0.0)), NSValue(caTransform3D: CATransform3DMakeTranslation(6.0, 0.0, 0.0))] shake.autoreverses = true shake.repeatCount = 2.0 shake.duration = 0.07 self.layer.add(shake, forKey: "shake") }