cgpath
How to animate a human written stroke using Swift/iOS?
A couple of concepts in the Apple CAShapeLayer (strokeStart and strokeEnd) really don’t seem to operate as expected when animated. But surely animating the strokeEnd is exactly what you want to do. Use multiple CAShapeLayers over top of one another, each one representing one stroke of the pen to form the desired character shape.
Why is ‘nil’ not compatible with ‘UnsafePointer’ in Swift 3?
Try this: let path = CGMutablePath() path.move(to: CGPoint(x: 30, y: 0)) CGPath APIs are now imported as instance methods in Swift 3. You can check them with Command-clicking on CGMutablePath. Or see the latest reference of CGMutablePath.
Where and how to __bridge
The documentation on the use of the bridge keyword can be found here. Specifically, I want to point out ยง3.2.4: (__bridge T) op casts the operand to the destination type T. If T is a retainable object pointer type, then op must have a non-retainable pointer type. If T is a non-retainable pointer type, then … Read more
How can i convert NSBezierPath to CGPath
Right from Apple documentation: Creating a CGPathRef From an NSBezierPath Object Here is the relevant code. @implementation NSBezierPath (BezierPathQuartzUtilities) // This method works only in OS X v10.2 and later. – (CGPathRef)quartzPath { int i, numElements; // Need to begin a path here. CGPathRef immutablePath = NULL; // Then draw the path elements. numElements = … Read more