sejal thesiya sejal thesiya - 2 months ago 24
Swift Question

Getting an error CGPathAddPath is unavailable: Use addPath(_:transform) Using Xcode 8.0

Getting an error.


CGPathAddPath is unavailable: Use addPath(_:transform) Using Xcode 8.0


for index in 0...(chars.count - 1)
{

let letter = CTFontCreatePathForGlyph(borderFont, glyphs[index], nil)

var t = CGAffineTransform(translationX: xPosition , y: 0)

CGPathAddPath(letters, &t, letter)

xPosition = xPosition + advances[index].width

}

Answer

Use addPath(_:transform) like this way.

 letters.addPath(letter, transform:t)

Check Apple Documentation on CGMutablePath for more details.

Comments