String
public extension String
String+Measurer add additional support for displaying a string on the screen.
Version
1.5.0Date
15/08/2019-
Get the width of a string with a specific font.
Declaration
Swift
func measuredWidth(with font: UIFont) -> CGFloatParameters
fontThe font.
Return Value
The width.
-
Get the width of a string with a specific font.
Declaration
Swift
func measuredHeight(with font: UIFont) -> CGFloatParameters
fontThe font.
Return Value
The height.
-
Get the actual line amount displayed on the screen.
Declaration
Swift
func measuredLineAmount(with font: UIFont, in view: UIView) -> IntParameters
fontThe font that is applied.
viewThe view that text is in.
Return Value
The actual line amount displayed on the view.
-
Get the actual height of the string displayed on the screen.
Declaration
Swift
func measuredHeight(with font: UIFont, in view: UIView) -> CGFloatParameters
fontThe font that is applied.
viewThe view that text is in.
Return Value
The actual height displayed on the view.
-
Get the actual lines displayed on the screen.
Declaration
Swift
func measuredLines(with font: UIFont, in view: UIView) -> [String]Parameters
fontThe font that is applied.
viewThe view that text is in.
Return Value
The actual lines displayed on the view.
String Extension Reference