/// 快速改变字间距
/// - Parameter space:
funcchangeWordSpace(space:CGFloat) {
guardlettext =self.textelse{return}
letattributedString =NSMutableAttributedString.init(string: text)
attributedString.addAttribute(NSAttributedString.Key.kern, value: space, range:NSRange(location:0, length: text.count))
self.attributedText= attributedString
self.sizeToFit()
}
网友评论