I have been getting a swift build error.
func pathRefFromText() -> CGPathRef {
let attributed : NSAttributedString = self.attrubutedText
let line : CTLineRef = CTLineCreateWithAttributedString(attributed as! CFAttributedStringRef)
let runArray : CFArrayRef = CTLineGetGlyphRuns(line)
for var runIndex = 0; runIndex < CFArrayGetCount(runArray); runIndex++ {
let run: CTRunRef = (CFArrayGetValueAtIndex(runArray, runIndex) as! CTRunRef)
// let runFont : CTFontRef = CFDictionaryGetValue(CTRunGetAttributes(run), kCTFontAttributeName)
for(var runGlyphIndex = 0; runGlyphIndex < CTRunGetGlyphCount(run); runGlyphIndex++)
{
let thisGlyphRange : CFRange = CFRangeMake(runGlyphIndex, 1)
let glyph : CGGlyph!
let position : CGPoint!
// The build error comes in these two lines
CTRunGetGlyphs(run, thisGlyphRange, glyph)
CTRunGetPositions(run, thisGlyphRange, position)
}
}
}
I get a build error saying Cannot convert value of type 'CGPoint!' to expected argument type 'UnsafeMutablePointer'