You can copy the context's current path using CGContextCopyPath
.
There is no function that copies the clipping path. Indeed, the clipping region won't be defined by a path if you've used CGContextClipToMask
.
Frage
I have a bezier path inside the current graphics context that I want to store as a UIBezierPath or CGPath. Do you know how to get the path out of a CGContextRef?
Lösung
You can copy the context's current path using CGContextCopyPath
.
There is no function that copies the clipping path. Indeed, the clipping region won't be defined by a path if you've used CGContextClipToMask
.
Andere Tipps
You can use the CGContextCopyPath
function:
CGPathRef myPath = CGContextCopyPath(context);
You can just use for coping the path.
let copy = context.path