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:

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 FUIPasscodeInputController storyboard in SAPFioriUI framework bundle. App programmer needs to provide the properties needed in UIController’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)

  • App may provide a custom background image to be displayed under the Touch ID authentication popup.



    public var customBackgroundImage: UIImage? = nil
  • If this property is true, a Cancel bar button item will be shown. When that Cancel bar button item is tapped, the didCancelPasscodeEntry function of the delegate will be invoked. The default is false.



    public var isToShowCancelBarItem = false
  • If this property is true, a Reset Passcode button will be displayed when user entered a wrong passcode. The default is true.



    public var isToShowResetButton = true
  • Creates a FUIPasscodeInputController object from storyboard.



    public class func createInstanceFromStoryboard() -> FUIPasscodeInputController?

    Return Value

    A FUIPasscodeInputController object.