Auto resize TileView.digitLabel with adjustsFontSizeToFitWidth
This commit is contained in:
parent
04716937eb
commit
4e619b04f0
|
@ -69,6 +69,9 @@ class ViewController: UIViewController, SplitflapDataSource, SplitflapDelegate {
|
|||
builder.textAlignment = .center
|
||||
builder.textColor = .white
|
||||
builder.lineColor = .darkGray
|
||||
|
||||
//Prefilled with false value, so could be ignored 👇
|
||||
builder.adjustsFontSizeToFitWidth = false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -97,6 +97,13 @@ public final class FlapViewBuilder {
|
|||
*/
|
||||
public var flipPointHeightFactor: CGFloat = 1.0
|
||||
|
||||
/**
|
||||
The on/off toggle for a label's property "adjustsFontSizeToFitWidth" inside every flap
|
||||
|
||||
By defaul the value is false, but it could be changed while initing a builder
|
||||
*/
|
||||
public var adjustsFontSizeToFitWidth: Bool = false
|
||||
|
||||
// MARK: - Initializing a Flap View
|
||||
|
||||
/**
|
||||
|
|
|
@ -98,6 +98,7 @@ final class TileView: UIView {
|
|||
digitLabel.textAlignment = builder.textAlignment
|
||||
digitLabel.textColor = builder.textColor
|
||||
digitLabel.backgroundColor = builder.backgroundColor
|
||||
digitLabel.adjustsFontSizeToFitWidth = builder.adjustsFontSizeToFitWidth
|
||||
flipPointHeightFactor = builder.flipPointHeightFactor
|
||||
|
||||
addSubview(digitLabel)
|
||||
|
|
Loading…
Reference in New Issue