malcommac / SwiftRichString

👩‍🎨 Elegant Attributed String composition in Swift sauce
MIT License
3.11k stars 211 forks source link

The attributes field not returning everything #56

Closed robertodias180 closed 5 years ago

robertodias180 commented 5 years ago

I have this style:

let inputStyle = Style {
        $0.font = UIFont.bsFont(type: .medium, size: 13)
        $0.color = UIColor.white
        $0.kerning = Kerning.point(0.2)
}

On V2.0.1 inputStyle.attributes returns 3 atrributes. On V2.0.5 inputStyle.attributes returns 1 atrributes.

armcast commented 5 years ago

+1

malcommac commented 5 years ago

Fixed in 2.1.0. Now it returns

▿ 3 elements
  ▿ 0 : 2 elements
    ▿ key : NSAttributedStringKey
      - _rawValue : NSFont
    - value : <UICTFont: 0x7f90c7d05e40> font-family: "Helvetica"; font-weight: normal; font-style: normal; font-size: 34.00pt
  ▿ 1 : 2 elements
    ▿ key : NSAttributedStringKey
      - _rawValue : NSKern
    - value : 0.2
  ▿ 2 : 2 elements
    ▿ key : NSAttributedStringKey
      - _rawValue : NSColor
    - value : UIExtendedGrayColorSpace 1 1