FontFit
1.0.0



FontFit缩放文本元素(即UILabel或UITextView )的font大小填充其容器。
fontFit是sizeToFit()的缺失倒数。 FontFit扩展是对Uilabel的AndupsFontSizetoFitWidth的更详细的实现,仅降低了字体尺寸。
注意:可以在示例项目中找到一个完整的示例用例。
let label = UILabel ( frame : ... )
// Increase font to fill the label's frame.
label . fitTextToBounds ( ) let label = UILabel ( frame : ... )
// Increase font to fill the label's frame, attempting to distribute onto, at most, 2 lines.
label . fitText ( maxLines : 2 ) FontFit可根据MIT许可获得。有关更多信息,请参见许可证文件。