Passcode Input Controller¶
FUIPasscodeInputController¶
public class FUIPasscodeInputController: FUIPasscodeController, FUIPasscodeViewDelegate
This UIViewController is to be used by app to authenticate user by either Touch ID or Passcode.
Before the navigation controller presents this FUIPasscodeInputController, the following properties
needs to be setup:
- Delegate: An implementation of
FUIPasscodeControllerDelegateto handle events from this controller. - hashUserPasscode: This boolean property needs to be the same as the same property in
FUIPasscodeCreateControllerthat was used to setup the passcode. - userIdentifier: This String property also needs to be the same as the same property in
FUIPasscodeCreateControllerthat was used to setup the passcode.
This controller will try to determine if Touch ID is enabled by retrieving the value from keychain. If Touch ID is enabled, there will be Touch ID authentication popup to prompt user authenticate with Touch ID.
If Touch ID authentication succeeded, the saved passcode will be retrieved and function
shouldTryPasscode of the FUIPasscodeControllerDelegate implementation will be invoked.
If Touch ID authentication is canceled or failed, the passcode view will be shown to prompt user
enter passcode. After user entered the passcode, function shouldTryPasscode of the
FUIPasscodeControllerDelegate implementation will be invoked.
The delegate should dismiss this controller after the passcode is verified.
This passcode input flow is implemented in FUIPasscodeInputController.storyboard. There are two ways to invoke it:
- Use another story board and using a "Present Modally" segue to
FUIPasscodeInputControllerstoryboard inSAPFioriUIframework bundle. App programmer needs to provide the properties needed inUIController's prepare for segue function:
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
let destination = segue.destination as! UINavigationController
let vc0 = destination.viewControllers[0]
let vc = vc0 as! FUIPasscodeInputController
vc.delegate = passcodeControllerDelegate
}
- Programmatically loads it:
let storyboard = UIStoryboard(name: "FUIPasscodeInputController", bundle: bundle)
let vc = storyboard.instantiateViewController(withIdentifier: "PasscodeInputViewController")
let passcodeVC = vc as! FUIPasscodeInputController
// present the passcode view
let navController = UINavigationController(rootViewController: passcodeVC)
self.navigationController?.present(navController, animated: true, completion: nil)
Theming¶
Supported style classes
fdlFUIPasscodeInputController
fdlFUIPasscodeInputController_doneItem
fdlFUIPasscodeInputController_cancelItem
fdlFUIPasscodeInputController_navigationBar