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

Convert NsNumber, NSDate to String in iOS Swift

Global LocationManager Singleton class iOS Swift