textContentType = .oneTimeCode not displaying code from sms
Closed this issue · 2 comments
I really love this textfield.
I was using the feature textContentType = .oneTimeCode but was not getting the code from sms.
I tried setting autocorrectionType = .yes to try and make the grey bar appear but I was not successful.
Any suggestion would help. Thank you!!
@HTJohn thanks for the appreciation.
Unfortunately, auto-fill won't work with PinCodeTextField.
Apple doc on auto-fill
iOS supports Password AutoFill on UITextField, UITextView, and any custom view that adopts the UITextInput protocol.
PinCodeTextField is based on another protocol (UIKeyInput) which is a lot simpler to implement and is enough for simple code input.
Custom control implementation that is based on UITextInput, requires to define a complex text input system which seems to be too complicated for the task of PIN code entering, especially if the only reason of implementation is an auto-fill.
If you need to support an auto-fill in your text input I would suggest to use UITextField or UITextView and customize it.
Thanks Oleksandr for your advice. I appreciate it! I will look into that.