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許可獲得。有關更多信息,請參見許可證文件。