TimOliver / TOPasscodeViewController

A modal passcode input and validation view controller for iOS
MIT License
385 stars 96 forks source link

Clear passcode to simplify controller re-use #29

Open adamrothman opened 6 years ago

adamrothman commented 6 years ago

Hardware / Software

Which version of the library were you using? 0.0.2 Which version of iOS are you running? 11.3 (simulator) What model of iOS device were you testing on? iPad Pro 10.5 (simulator) If using CocoaPods, which version of CocoaPods are you on? 1.5.3

Feature request

I would like to avoid creating a new instance of TOPasscodeViewController every time I want to present one. Instead, I'd like to re-use an instance that's created and owned by the presenting controller.

I can accomplish this now, but the second time I present the passcode TOPasscodeViewController, it still has its dots filled in from the previous entry.

It seems like there are two ways to solve this:

  1. Automatically clear the entered passcode when passcodeViewController(_:isCorrectCode:) returns a success.
  2. Expose an additional method on TOPasscodeViewController – something like clearPasscode().