Guest User

Untitled

a guest
Feb 17th, 2019
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.93 KB | None | 0 0
  1. @objc func uiContentSizeCategoryChanged() {
  2. guard let attributedString = display.attributedText else {
  3. return
  4. }
  5.  
  6. let mutableText = NSMutableAttributedString(attributedString: attributedString)
  7. let fullTextRange = NSRange(location: 0, length: mutableText.string.count)
  8.  
  9. mutableText.enumerateAttributes(in: fullTextRange, options: []) { attributes, range, stop in
  10. print(attributes[.font])
  11. }
  12.  
  13. /// Optional(<UICTFont: 0x7f8a26429720> font-family: ".SFUIText-Bold"; font-weight: bold; font-style: normal; font-size: 18.00pt)
  14. /// Optional(<UICTFont: 0x7f8a26403c80> font-family: ".SFUIText-Light"; font-weight: normal; font-style: normal; font-size: 8.00pt)
  15. /// Optional(<UICTFont: 0x7f8a26429c30> font-family: "NeutrafaceSlabText-Demi"; font-weight: bold; font-style: normal; font-size: 18.00pt)
  16. /// Optional(<UICTFont: 0x7f8a2642aa30> font-family: ".SFUIText-Heavy"; font-weight: bold; font-style: normal; font-size: 48.00pt)
  17. }
Add Comment
Please, Sign In to add comment