@@ -33,13 +33,13 @@ open class GrowingTextView: UITextView {
3333 @IBInspectable open var maxHeight : CGFloat = 0 {
3434 didSet { forceLayoutSubviews ( ) }
3535 }
36- @IBInspectable open var placeHolder : String ? {
36+ @IBInspectable open var placeholder : String ? {
3737 didSet { setNeedsDisplay ( ) }
3838 }
39- @IBInspectable open var placeHolderColor : UIColor = UIColor ( white: 0.8 , alpha: 1.0 ) {
39+ @IBInspectable open var placeholderColor : UIColor = UIColor ( white: 0.8 , alpha: 1.0 ) {
4040 didSet { setNeedsDisplay ( ) }
4141 }
42- @IBInspectable open var attributedPlaceHolder : NSAttributedString ? {
42+ @IBInspectable open var attributedPlaceholder : NSAttributedString ? {
4343 didSet { setNeedsDisplay ( ) }
4444 }
4545
@@ -144,24 +144,24 @@ open class GrowingTextView: UITextView {
144144 let yValue = textContainerInset. top
145145 let width = rect. size. width - xValue - textContainerInset. right
146146 let height = rect. size. height - yValue - textContainerInset. bottom
147- let placeHolderRect = CGRect ( x: xValue, y: yValue, width: width, height: height)
147+ let placeholderRect = CGRect ( x: xValue, y: yValue, width: width, height: height)
148148
149- if let attributedPlaceholder = attributedPlaceHolder {
150- // Prefer to use attributedPlaceHolder
151- attributedPlaceholder. draw ( in: placeHolderRect )
152- } else if let placeHolder = placeHolder {
153- // Otherwise user placeHolder and inherit `text` attributes
149+ if let attributedPlaceholder = attributedPlaceholder {
150+ // Prefer to use attributedPlaceholder
151+ attributedPlaceholder. draw ( in: placeholderRect )
152+ } else if let placeholder = placeholder {
153+ // Otherwise user placeholder and inherit `text` attributes
154154 let paragraphStyle = NSMutableParagraphStyle ( )
155155 paragraphStyle. alignment = textAlignment
156156 var attributes : [ NSAttributedStringKey : Any ] = [
157- . foregroundColor: placeHolderColor ,
157+ . foregroundColor: placeholderColor ,
158158 . paragraphStyle: paragraphStyle
159159 ]
160160 if let font = font {
161161 attributes [ . font] = font
162162 }
163163
164- placeHolder . draw ( in: placeHolderRect , withAttributes: attributes)
164+ placeholder . draw ( in: placeholderRect , withAttributes: attributes)
165165 }
166166 }
167167 }
0 commit comments