File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed
TextFieldEffects/TextFieldEffects Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ import UIKit
3737
3838 /**
3939 The color of the placeholder text.
40-
40+
4141 This property applies a color to the complete placeholder string. The default value for this property is a black color.
4242 */
4343 @IBInspectable dynamic public var placeholderColor : UIColor = . blackColor( ) {
@@ -46,6 +46,17 @@ import UIKit
4646 }
4747 }
4848
49+ /**
50+ The scale of the placeholder font.
51+
52+ This property determines the size of the placeholder label relative to the font size of the text field.
53+ */
54+ @IBInspectable dynamic public var placeholderFontScale : CGFloat = 0.65 {
55+ didSet {
56+ updatePlaceholder ( )
57+ }
58+ }
59+
4960 override public var placeholder : String ? {
5061 didSet {
5162 updatePlaceholder ( )
@@ -133,7 +144,7 @@ import UIKit
133144 }
134145
135146 private func placeholderFontFromFont( font: UIFont ) -> UIFont ! {
136- let smallerFont = UIFont ( name: font. fontName, size: font. pointSize * 0.65 )
147+ let smallerFont = UIFont ( name: font. fontName, size: font. pointSize * placeholderFontScale )
137148 return smallerFont
138149 }
139150
You can’t perform that action at this time.
0 commit comments