How do you satisfy the 'lineOrigins' argument in CTFrameGetLineOrigins() in Swift? [duplicate]
问题 This question already has an answer here : Issue with CoreText CTFrameGetLineOrigins in Swift (1 answer) Closed last year . I'm trying to figure out CTFrameGetLineOrigins from here: CTFrameGetLineOrigins Got Incorrect Origins, and trying to convert the ObjC to Swift. Obj-C: CFArrayRef lines = CTFrameGetLines(frame); size_t numOfLines = CFArrayGetCount(lines); CGPoint lineOrigins[numOfLines]; CTFrameGetLineOrigins(frame, CFRangeMake(0, 0), lineOrigins); Swift: let lines = CTFrameGetLines(frame