Chciałbym animować UIBezierPath z rect do trójkąta jeden, aby nie animować widok na ścieżce, ale animować samą ścieżkę, więc zmienia się z jednego kształtu na inny. ścieżka jest dodawana do CALayerJak animować UIBezierPath
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];
}
dzięki, proste. używałem CAKeyframeAnimation. –