Copy folder “FDLabelView” which include following header and source files into your project.
FDLabelView suppot paddings by assign contentInset, default value is UIEdgeInsetsZero.
FDLabelView ignore UILabel.textAlignment by using FDLabelView.fdTextAlignment, which support additional alignment methods, Justify and Fill.
FDLabelView support automatic adjustment for view frame to fit content.
When fdAutoFitMode is set to FDAutoFitModeFrame, the label will automatically enable adjustsFontSizeToFitWidth feature. The size of font will be adjusted until the text can be completed rendered within its frame. It will try to fit content into current frame by decreasing the size of font and frame size of the view.
If you set adjustsFontSizeToFitWidth to TRUE in this mode, it will behave like FDAutoFitModeContrainedFrame mode, which means it will automatically reduce the size of font to fit content into current frame size. However it won’t change the frame size of the view.
Specify the alignment methods used for auto fit content to frame.
Default value is 0.
Default value is 1. This feature is only enable when fixedLineHeight equals 0. It will scale the line height of different size of font, which is used combing the FDLabelView.fdLineScaleBaseLine (see below).
The baseline for scaling line heights.
Inherited from UILabel, default value is 1. This property can afftect the rendering results in all FDAutoFitMode modes.
Inherited from UILabel, default value is FALSE. This property can only affect the rendering results in FDAutoFitModeNone mode. The value is automatically set to TRUE in FDAutoFitModeFrame mode. It is used with UILabel.minimumScaleFactor.
Enable debug mode, this must be enable after the label was added to another parent view. Sepicify the parent view for displaying the runtime editor (required):
Pre-assign some sentences or words with different length or language for tests (optional):
Assign the output variable name, default is ‘labelView’ (optional):
Visualization, default values are YES
FDLabelView runtime editor allow you to output the edited and modified results of label to codes by following steps: