FUIPasscodeController

public class FUIPasscodeController: UIViewController

This is the base class of FUIPasscodeCreateController and FUIPasscodeInputController. It has the common codes for those two view controllers.

Note that both Passcode screen and Touch ID screen are supported for iPad portrait and landscape orientation and iPhone portrait orientation only. Since the screens are not supported in iPhone landscape orientation, the app installed in iPhone needs to switch to portrait mode before presenting these screens. And AppDelegate needs to lock the screen orientation when these screens are shown, similar to the following code snippet.

In app’s AppDelegate:


 public var inPasscodeView: Bool = false

 // implement this function to support only portrait orientation when FUPasscodeView is displayed in iPhone.
 func application(_ application: UIApplication, supportedInterfaceOrientationsFor window: UIWindow?) -> UIInterfaceOrientationMask {
     if !inPasscodeView {
         return .allButUpsideDown
     } else {
         return .portrait
     }
 }

Before presenting the Passcode or Touch ID screen:


 // Let AppDelegate know that we are entering FUIPasscodeView
 (UIApplication.shared.delegate as! AppDelegate).inPasscodeView = true

 // Make sure we rotate to portrait mode
 let value = UIInterfaceOrientation.portrait.rawValue
 UIDevice.current.setValue(value, forKey: "orientation")
 // Present the passcode view
 self.navigationController?.present(navController, animated: true, completion: nil)

After dismissing the Passcode or Touch ID screen:


 passcodeController.dismiss(animated: true, completion: nil)
 // Let AppDelegate know that we are exiting FUIPasscodeView
 (UIApplication.shared.delegate as! AppDelegate).inPasscodeView = false

The strings used in FUIPasscodeSetupView, FUIPasscodeView, and FUITouchIDView are from localized Onboarding.strings file. Application can override these strings by setting the corresponding static variables in this FUIPasscodeController class at runtime.

  • The FUIPasscodeControllerDelegate implementation.

    Declaration

    Swift

    public weak var delegate: FUIPasscodeControllerDelegate!
  • The title for the passcode setup screens. The default is from localized strings file - Set Passcode.

    Declaration

    Swift

    public static var setPasscodeTitleString: String?
  • The title for the enter passcode screen. The default is from localized strings file - Passcode.

    Declaration

    Swift

    public static var passcodeTitleString: String?
  • The message on the confirm passcode screen. The default is from localized strings file - Confirm your passcode.

    Declaration

    Swift

    public static var confirmPasscodeString: String?
  • The message on the input passcode screen. The default is from localized strings file - Enter your passcode

    Declaration

    Swift

    public static var enterYourPasscodeMessageString: String?
  • The message on the change passcode screen to ask user enter current passcode. The default is from localized strings file - Enter your current passcode

    Declaration

    Swift

    public static var enterYourCurrentPasscodeMessageString: String?
  • The button title string used in touch ID screen to indicate not to setup now.

    Declaration

    Swift

    public static var notNowButtonString: String?
  • The button title string used on the second passcode setup to go back to the first screen.

    Declaration

    Swift

    public static var backItemString: String?
  • The button title string used on the first passcode setup to go to the next screen.

    Declaration

    Swift

    public static var nextItemString: String?
  • The main message format on the setup passscode screen. The %d will display the number of characters required from the passcode policy. The default format is from localized strings file - Choose a passcode with a minimum of %d characters

    Declaration

    Swift

    public static var setPasscodeMessageFormat: String?
  • The main message format on the setup passscode screen when the isDititsOnly property of the passcode policy is true. The %d will display the number of digits required from the passcode policy. The default format is from localized strings file - Choose a passcode with a minimum of %d digits

    Declaration

    Swift

    public static var setPasscodeWithDigitsMessageFormat: String?
  • The message format for choosing passcode from the number of character groups when passcode policy requires it. The default format is from localized strings file - Include at least %d of the following:

    Declaration

    Swift

    public static var chooseMinGroupsMessageFormat: String?
  • The group name for lower case letters. The default string is from localized strings file - Lower case (a-z)

    Declaration

    Swift

    public static var lowerCaseLabelString: String?
  • The group name for upper case letters. The default string is from localized strings file - Upper case (A-Z)

    Declaration

    Swift

    public static var upperCaseLabelString: String?
  • The group name for digits. The default string is from localized strings file - Digits (0-9)

    Declaration

    Swift

    public static var digitsLabelString: String?
  • The group name for non-alphabetic characters. The default string is from localized strings file - Non-alphabetic (!@#…)

    Declaration

    Swift

    public static var nonAlphabeticLabelString: String?
  • The button title for resetting passcode. The default string is from localized strings file - Reset Passcode

    Declaration

    Swift

    public static var resetPasscodeButtonString: String?
  • Alert message when validate method of FUIPasscodeValidationDelegate returning false for the passcode user entered in setup passcode. The default string is from localized strings file - Passcode validation failed.

    Declaration

    Swift

    public static var passcodeValidationFailedMessageString: String?
  • Alert message when the passcode user entered was rejected by the FUIPasscodeControllerDelegate’s shouldTryPasscode function. The default string is from localized strings file - Passcode was rejected by FUIPasscodeControllerDelegate.

    Declaration

    Swift

    public static var passcodeRejectedMessageString: String?
  • The alert button title used on passcode validation failed, or passcode rejected. The default is from localized strings file - Retry

    Declaration

    Swift

    public static var retryButtonString: String?
  • The title for setup touch ID screen. The default string is from localized strings file - Touch ID

    Declaration

    Swift

    public static var touchIDTitleString: String?
  • The first paragraph of the message on the Touch ID screen. The default string is from localized strings file - Enabling Touch ID will allow quick access to your information.

    Declaration

    Swift

    public static var touchIDMessage1String: String?
  • The second paragraph of the message on the Touch ID screen. The default string is from localized strings file - You can turn this feature On or Off anytime from Settings.

    Declaration

    Swift

    public static var touchIDMessage2String: String?
  • The message for the link on the Touch ID screen. The default string is from localized strings file - Learn more about Touch ID

    Declaration

    Swift

    public static var learnMoreTouchIDLinkString: String?
  • The button title to enable Touch ID authentication. The default is from localized strings file - Enable

    Declaration

    Swift

    public static var enableButtonString: String?
  • The message displayed when authenticate with Touch ID. The default string is from localized strings file - Authenticate with Touch ID

    Declaration

    Swift

    public static var authenticateWithTouchIDMessageString: String?
  • The message when the passcode entered in confirm passcode screen does not match with the one entered in the setup passcode screen. The default string is from localized strings file - Passcodes did not match. Try again.

    Declaration

    Swift

    public static var passcodeNotMatchMessageString: String?
  • The message format to be displayed when user entered wrong passcode and the remaining number of retries is greater than 1. The default format is from localized strings file - You hava %d attempts left

    Declaration

    Swift

    public static var attemptsLeftMessageFormat: String?
  • The message string to be displayed when user entered wrong passcode and there is only one remaining retry. The default string is from localized strings file - You have 1 attempt left

    Declaration

    Swift

    public static var oneAttempLeftMessageFormat: String?
  • The first paragraph of the alert message when the number user entered wrong passcode reached maximum allowed. The default string is from localized strings file - Maximum Passcode Attempts Reached

    Declaration

    Swift

    public static var maxAttemptsReachedMessageString: String?
  • The second paragraph of the alert message when the number user entered wrong passcode reached maximum allowed. The default string is from localized strings file - Please enter your credentials to Sign in and reset the passcode

    Declaration

    Swift

    public static var enterCredentialsMessageString: String?
  • The text of the dismiss button on the alert when the number user entered wrong passcode reached maximum allowed. The default string is from localized strings file - OK

    Declaration

    Swift

    public static var okButtonString: String?
  • The message on the passcode screen when user entered wrong passcode and there is no limit on the number of retries. The default string is from localized strings file - Incorrect passcode. Try again.

    Declaration

    Swift

    public static var retryPasscodeMessageString: String?
  • Allow content-driven resizing for all the buttons that support the feature in the screens. The default is false. Default to the size defined in Fiori Design Pattern

    Declaration

    Swift

    public static var allowButtonsToUseIntrinsicContentSize: Bool = false
  • Checks to see if touchID is enabled

    Declaration

    Swift

    public class func isTouchIDEnabled() -> Bool

    Return Value

    true if touchID is enabled; otherwise, it’s disabled.

  • Enabling touchID by saving touchID enabling related data - param: passcode to be saved

    Declaration

    Swift

    public class func enableTouchID(forPasscode passcode: String)
  • Clears touchID enabling entries created by the framework passcode controllers in the keychain.

    Declaration

    Swift

    public class func clearTouchIDSettings()
  • Clears passcode-related (including touchID) entries created by the framework passcode controllers in the keychain.

    Declaration

    Swift

    public class func clearPasscodeSettings()