Advertisement
Guest User

Untitled

a guest
Feb 8th, 2016
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1.  
  2. import CoreText
  3.  
  4. extension CTFrame {
  5.  
  6. var lines: [CTLine] {
  7.  
  8. // This is the only way I've currently found to get the
  9. // CFArray of CTLines to cast to a swift array.
  10. let linesAO: [AnyObject] = CTFrameGetLines(self) as [AnyObject]
  11. guard let lines = linesAO as? [CTLine] else {
  12. return []
  13. }
  14.  
  15. return lines
  16. }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement