VPMOTPView icon indicating copy to clipboard operation
VPMOTPView copied to clipboard

i need forcus auto on first circle and show keyboard

Open mhtranbn opened this issue 7 years ago • 4 comments

many thank for this library, thank for support, i need forcus auto on first circle and show keyboard.

mhtranbn avatar Oct 02 '17 03:10 mhtranbn

Hi @mhtranbn ,

Sorry for the late reply.

I have now added the support for the same. Now you can make use of a new delegate called

shouldBecomeFirstResponderForOTP

which will be called automatically and you can return true if you need auto focus for the field and false if not needed. Let me know if you need anything.

Thanks for using the library and your support. Closing the issue.

Thanks, Varun

varunpm1 avatar Nov 01 '17 14:11 varunpm1

Hi, @varunpm1 It is not working in my case. Can you elaborate how it works? Using following code: [vmOtpCode.delegate = self vmOtpCode.initalizeUI()]

and delegate extension OTPVerifyViewController: VPMOTPViewDelegate { func shouldBecomeFirstResponderForOTP(otpFieldIndex index: Int) -> Bool { return true } }

NirajCapermint avatar Jul 03 '19 11:07 NirajCapermint

@varunpm1 @mhtranbn I have used following solution: Add following line of code otpField.becomeFirstResponder() on VPMOTPView.swift file on line number 186

NirajCapermint avatar Jul 03 '19 12:07 NirajCapermint

@NirajCapermint Let me look into this and get back to you. Reopening for my reference.

varunpm1 avatar Jul 12 '19 07:07 varunpm1