मेरे एप्लिकेशन में मैं एनीमेशन के लिए CABasicAnimation का उपयोग कर रहा हूं। मैं गतिशील रूप से एनीमेशन की गति को बदलना चाहता हूं इसलिए मैंने गति को बदलने के लिए एक स्लाइडर जोड़ा है। मेरा एनीमेशन कोड निम्नलिखित है। लेकिन मैं गति को बदलने में सक्षम नहीं हूं, जब मैं गति के मूल्य को बदलता हूं तो कुछ भी नहीं होता है।एनीमेशन CABasicAnimation
CABasicAnimation * a = [CABasicAnimation animationWithKeyPath:@"position"];
[a setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear]];
CGPoint startPt = CGPointMake(self.view.bounds.size.width + displayLabel.bounds.size.width/2,
displayLabel.frame.origin.y);
CGPoint endPt = CGPointMake(displayLabel.bounds.size.width/-2, displayLabel.frame.origin.y);
[a setFromValue:[NSValue valueWithCGPoint:startPt]];
[a setToValue:[NSValue valueWithCGPoint:endPt]];
[a setAutoreverses:NO];
[a setDuration:speeds];
[a setRepeatCount:HUGE_VAL];
[displayLabel.layer addAnimation:a forKey:@"rotationAnimation"];
- (IBAction)speedSlider:(id)sender {
speeds = slider.value;
}
[एक चल एनीमेशन पर बदलें अवधि (गति)] के संभावित डुप्लिकेट (https://stackoverflow.com/questions/21589483/change-duration-speed-on-a-running-animation) – Fattie
** पूर्ण समाधान 2017 ** के लिए ...https://stackoverflow.com/a/45787919/294884, phew – Fattie