// // UILabel+Extension.swift // MTP2_iOS // // Created by zhongyuan on 2018/4/28. // Copyright © 2018年 zhongyuan.All rights reserved. // import Foundation import UIKit extension UILabel { /// 便利构造方法 /// /// - Parameters: /// - text: 标签内容 /// - fontSize: 字体大小 /// - color: 字体颜色 convenience init(text: String, fontSize: CGFloat = 14, color: UIColor = UIColor.black) { self.init() self.text = text self.font = UIFont.systemFont(ofSize: fontSize) self.textColor = color self.numberOfLines = 0 self.sizeToFit() } }