PinCodeTextField icon indicating copy to clipboard operation
PinCodeTextField copied to clipboard

.oneTimeCode

Open FarhanBykea opened this issue 5 years ago • 5 comments

Does it support textContentType = .oneTimeCode ??

FarhanBykea avatar Jan 17 '20 11:01 FarhanBykea

Does this support keyboard auto fill for onetime code?

sanjeevi-k avatar Jan 28 '20 19:01 sanjeevi-k

Hi guys, sorry for delay. This control doesn't support .oneTimeCode, please take a look at https://github.com/tkach/PinCodeTextField/issues/44 for detailed explanation. I would suggest to use UITextField or UITextView and customize it or look for third-party controls specifically saying .oneTimeCode is supported

tkach avatar Jan 30 '20 08:01 tkach

@tkach @FarhanBykea as a trick, just put a textfield (with transparent background and text color) above the PinCodeTextField and in it's textDidChange delegate set the new text to pintextfield's text... with rx it is just a line of code

       dummyTextField
          .rx
          .text
          .changed
          .subscribe(onNext: {[weak self] text in
                  self?.otpTextField.text = text
           })
        .disposed(by: self.disposeBag)

valentinjahanmanesh avatar Apr 15 '20 10:04 valentinjahanmanesh

@farshadjahanmanesh this can also be achieved by using property observer as I’m not currently using RXSwift.

FarhanBykea avatar Apr 15 '20 13:04 FarhanBykea

@FarhanBykea can this be done by creating a text field with code and put it above this control, Set its delegate, and assign text to this control got from delegate.

shoaibhassan1 avatar Dec 23 '20 12:12 shoaibhassan1