lineSpacing property inside UILabel doesn't work as expected
问题 I am trying to create a custom UILabel class which will allow me to increase the line spacing on a UILabel. I know you can do this in IB with an attributed text string, however it doesn't work if you are using custom fonts. Here is my class code: import UIKit @IBDesignable class SpacingLabel: UILabel { @IBInspectable var lineSpacing: CGFloat = 10.0 override func awakeFromNib() { self.renderText() } override func prepareForInterfaceBuilder() { super.prepareForInterfaceBuilder() self.renderText