File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed
Example/Example/Base.lproj Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change 20
20
<autoresizingMask key =" autoresizingMask" widthSizable =" YES" heightSizable =" YES" />
21
21
<subviews >
22
22
<textField opaque =" NO" clipsSubviews =" YES" contentMode =" scaleToFill" contentHorizontalAlignment =" left" contentVerticalAlignment =" center" borderStyle =" roundedRect" placeholder =" _ (___) ____ ____" textAlignment =" natural" minimumFontSize =" 17" translatesAutoresizingMaskIntoConstraints =" NO" id =" vrS-aj-jzx" customClass =" FormattedTextField" customModule =" Example" customModuleProvider =" target" >
23
+ <rect key =" frame" x =" 16" y =" 40" width =" 343" height =" 30" />
23
24
<nil key =" textColor" />
24
25
<fontDescription key =" fontDescription" type =" system" pointSize =" 20" />
25
- <textInputTraits key =" textInputTraits" />
26
+ <textInputTraits key =" textInputTraits" smartInsertDeleteType = " no " />
26
27
<userDefinedRuntimeAttributes >
27
28
<userDefinedRuntimeAttribute type =" string" keyPath =" textMask" value =" +× ××× ××× ××××××××" />
28
29
</userDefinedRuntimeAttributes >
Original file line number Diff line number Diff line change @@ -47,8 +47,13 @@ open class FormattedTextField: UITextField {
47
47
} else if let placeholder = super. placeholder {
48
48
placeholderLabel. text = placeholder
49
49
}
50
- // iOS 11: placeholderRect(forBounds:) returns empty rect when placeholder is empty
51
- super. placeholder = " "
50
+ if #available( iOS 11 , * ) {
51
+ // iOS 11: placeholderRect(forBounds:) returns empty rect when placeholder is empty
52
+ super. placeholder = " "
53
+ if smartInsertDeleteType != . no {
54
+ print ( " [FormattedTextField] warning: smartInsertDeleteType unsupports " ) ;
55
+ }
56
+ }
52
57
53
58
addSubview ( placeholderLabel)
54
59
}
You can’t perform that action at this time.
0 commit comments