को एनिमेट करने के लिए कैसे करें मैं पथ पर एक दृश्य को एनिमेट करने के लिए नहीं, बल्कि पथ को एनिमेट करने के लिए एक पथ के UIBezierPath को एनिमेट करना चाहता हूं, लेकिन यह एक आकार से दूसरे आकार में बदल जाता है। पथ एक CALayerUIBezierPath
CAShapeLayer *maskLayer = [CAShapeLayer layer];
maskLayer.fillColor = [[UIColor whiteColor] CGColor];
maskLayer.path = [self getRectPath];
-(CGPathRef)getTrianglePath
{
UIBezierPath* triangle = [UIBezierPath bezierPath];
[triangle moveToPoint:CGPointZero];
[triangle addLineToPoint:CGPointMake(width(self.view),0)];
[triangle addLineToPoint:CGPointMake(0, height(self.view))];
[triangle closePath];
return [triangle CGPath];
}
-(CGPathRef)getRectPath
{
UIBezierPath*rect = [UIBezierPath bezierPathWithRect:self.view.frame];
return [rect CGPath];
}
धन्यवाद, सरल। मैं CAKeyframe एनीमेशन का उपयोग कर रहा था। –