Я получаю быструю ошибку сборки.
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)
}
}
}
Я получаю сообщение об ошибке сборки: «Невозможно преобразовать значение типа «CGPoint!» к ожидаемому типу аргумента «UnsafeMutablePointer»