Sunspension / VKPinCodeView

VKPinCodeView is simple and elegant UI component for input PIN. You can easily customise appearance and get auto fill (OTP) iOS 12 feature right from the box.
MIT License
96 stars 25 forks source link

VKPinCodeView crashes if I paste in text longer than my PIN length #12

Open andreasamygdala opened 4 years ago

andreasamygdala commented 4 years ago

Terminating app due to uncaught exception 'NSRangeException', reason: ' __boundsFail: index 20 beyond bounds [0 .. 4]'

Right here: 0x0000000101be4e73 $s13VKPinCodeViewAAC10appendChar33_DE70FA91AF22EA7F25E32F03782F5828LLyySSF + 323

Sunspension commented 4 years ago

@andreasamygdala Could you provide steps for reproduce?

andreasamygdala commented 4 years ago

Sure thing - it's very easy to do in simulator... Just cmd-p something when the textfield is active.

I don't have my external keyboard with me at the mo, so I can't try it on device before sometime next week. In the meantime I tried inputting text from messages containing longer-than-expected pins. That worx.

So - not sure if this is actually a thing on target device. But it's an edge case, and doesn't seem like a problem at all, without external keys.

... Oh, and thanks for your effort with this whole thing! 👏👏👏