forcedotcom/SalesforceMobileSDK-iOS — pull request #226 by khawkins (2013-02-09 02:10:35+00:00)
Title: Management of encryption providers in the app

This is the second part of the passcode update, which is the management of the passcode providers. It works as follows:

- `SFPasscodeManager` now has an NSString property called `preferredPasscodeProvider`. This is set in each of the parent app delegate's `init` methods.
- When the time comes that a passcode provider could be swapped for another (on the boundary of the app getting a user-entered plaintext passcode), `[SFPasscodeManager setPasscode:]`, in addition to its previous duties, will now swap out the old provider for the preferred, if it's different.
- `[SFSecurityLockout setPasscode:]` still does what it used to, notifying apps of passcode changes. It's just that now, passcode 'changes' could come with existing passcodes (switching providers). To that effect, `SFPasscodeViewController` now calls [SFSecurityLockout setPasscode:] on verification, where it used to just verify. This will end up a no-op in the cases where the passcode and provider haven't changed.
- Miscellaneous: I made the `SFPasscodeProvider` protocol implement a `providerName` property, for ease of use.
- The tests are actually built into the existing `SFSmartStoreTests`, which now swap around passcode providers with previous providers configured; the encryption/unencryption tests are the same.