Convert cgpath from superView to subVIew iOS swift

Problem:

I had a view with cgpath and i want to convert the to its subview with the same position.I had used the below code to achieve that

 Solution:

CGAffineTransform translation =  CGAffineTransformMakeTranslation(-View.frame.origin.x, -View.frame.origin.y;

CGPathRef movedPath = CGPathCreateCopyByTransformingPath(Path,&translation);

View.Path = movedPath;


Comments

Popular posts from this blog

Invalid bundle error while upload the app to the app Store

Saved Image in document directory and save path in coredata not able to fetch the image file iOS swift