Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import CoreText
- extension CTFrame {
- var lines: [CTLine] {
- // This is the only way I've currently found to get the
- // CFArray of CTLines to cast to a swift array.
- let linesAO: [AnyObject] = CTFrameGetLines(self) as [AnyObject]
- guard let lines = linesAO as? [CTLine] else {
- return []
- }
- return lines
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement