rolandleth / LTHPasscodeViewController

iOS 7 style Passcode Lock
MIT License
615 stars 142 forks source link

Explain how I can store users #196

Closed BCEst closed 5 years ago

BCEst commented 5 years ago

I am trying to make an app where the login screen is similar to Netflix where a user has multiple accounts and each account has a different passcode. Is it possible to be done with this library?

rolandleth commented 5 years ago

The library wasn't created (nor really tested) with multi-user support in mind, but I guess you could use keychainPasscodeUsername to distinguish between users.

You'd set it every time you interact with a different user.

[LTHPasscodeViewController sharedUser].keychainPasscodeUsername = @"userNameGoesHere";

But don't forget to set different values for the properties initialized in _loadKeychainDefaults for each user as well.

For example, the default keychainPasscodeUsername is @"demoPasscode" and the keychainPasscodeIsSimpleUsername is @"passcodeIsSimple". For user two, keychainPasscodeUsername could be @"passcodeUserTwo" and keychainPasscodeIsSimpleUsername could be @"passcodeIsSimpleUserTwo".

Sadly, I can't help any further than this, because, as I said, the library hasn't really been tested with multi-user support.