FUIPasscodeChangeController
@MainActor
public class FUIPasscodeChangeController : UINavigationController
Use this UINavigationController
to change the passcode screen flows in the application.
Set up the following properties before presenting this FUIPasscodeChangeController
:
passcodeControllerDelegate
: An implementation ofFUIPasscodeControllerDelegate
that handles events from this controller for bothFUIPasscodeInputController
andFUIPasscodeCreateController
.validationDelegate
: An implementation ofFUIPasscodeValidationDelegate
that validates the passcode entered by the user.
Note that the properties hashUserPasscode
and userIdentifier
need to be the same as the FUIPasscodeCreateController
in order for the change to be successful.
Here is the screen flow:
The first screen prompts the user to enter the current passcode using
FUIPasscodeInputController
. This controller always uses the passcode for authentication only. Note: If Touch ID is enabled, there will be Touch ID authentication popup to prompt user authenticate with Touch ID. Once user enters fingerprint or device passcode, the stored passcode in the keychain is retrieved and the delegate’sshouldTryPasscode
is invoked to validate the old passcode. And a new passcode is generated andshouldTryPasscode
is invoked again to validate the new passcode. The new passcode is then saved in the keychain without other user actions.The second screen prompts the user to enter a new passcode, which is validated by the
FUIPasscodePolicy
. TheFUIPasscodeControllerDelegate
provided functionvalidate
ofvalidationDelegate
is invoked for additional validation. Upon validation success, the next screen displays.The third screen prompts the user to enter the passcode again to verify the passcode entered in the second screen. After the setup is complete, the function
shouldTryPasscode
of theFUIPasscodeControllerDelegate
is invoked. The delegate should either create a secure store with the passcode, or save the passcode in a secure manner. Note: Changing the passcode does not affect the existing Touch ID preferences. No additional screens display to enable touchID to change the passcode flow. If touchID was previously disabled before triggering the passcode change, touchID remains disabled. However, if touchID was previously enabled, the internaltouchID-related
data is automatically updated after the passcode is changed.
This passcode flow change is implemented in FUIPasscodeChangeController.storyboard
. There are two ways to invoke it:
- Use another storyboard and add a “Present Modally” segue to the
FUIPasscodeChangeController
storyboard in theSAPFiori
framework bundle. The app developer must provide the required properties in theUIController
‘s prepare for segue function:
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
let changeController = segue.destination as! FUIPasscodeChangeController
changeController.passcodeControllerDelegate = passcodeControllerDelegate
changeController.validationDelegate = validationDelegate
}
- Programmatically load it:
let changeController = FUIPasscodeChangeController.createInstanceFromStoryboard()
changeController.passcodeControllerDelegate = passcodeControllerDelegate
changeController.validationDelegate = validationDelegate
self.present(changeController, animated: true, completion: nil)
-
An implementation of
FUIPasscodeControllerDelegate
passedFUIPasscodeInputController
andFUIPasscodeCreateController
.Declaration
Swift
@MainActor public weak var passcodeControllerDelegate: FUIPasscodeControllerDelegate?
-
An implementaiton of
FUIPasscodeValidationDelegate
passed toFUIPasscodeCreateController
for additional passcode validations during passcode create/changeDeclaration
Swift
@MainActor public weak var validationDelegate: FUIPasscodeValidationDelegate?
-
App may provide a custom background image to be displayed under the Touch ID authentication popup.
Declaration
Swift
@MainActor public var customBackgroundImage: UIImage?
-
This property indicates if the create passcode process includes a screen to enable TouchID or not. The default is true. Note that if there is no TouchID registered on the device, the enable TouchID screen will not be shown even if this property is true.
Declaration
Swift
@MainActor public var canEnableTouchID: Bool
-
This controller can create a hash of the user passcode to obfuscate the clear text user password. If enabled, the passcode given to
shouldTryPasscode
is derived from the user passcode. The default isfalse
.Declaration
Swift
@MainActor public var hashUserPasscode: Bool
-
An UUID type string to identify the user. This will be used as part of the name to store passcode related items in the keychain.
Declaration
Swift
@MainActor public var userIdentifier: String?
-
The keychain access group associated with this instance. When set, the passcode related items will be stored in the shared keychain.
Declaration
Swift
@MainActor public var keychainAccessGroup: String?
-
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 true.Declaration
Swift
@MainActor public var showsCancelBarItem: Bool
-
If this property is true, a “Reset Passcode” button will be displayed when user entered a wrong passcode. The default is true.
Declaration
Swift
@MainActor public var showsResetButton: Bool
-
If this property is set to true, a “Reset Passcode” button will always be displayed, irrespective of the value assigned to
showsResetButton
. The default value isfalse
.Declaration
Swift
@MainActor public var showsResetButtonAlways: Bool
-
If this property is true, user needs to input the passcode to authenticate even if Touch ID or Face ID is enabled. The default is
false
.Declaration
Swift
@MainActor public var isRequiringAlphaNumericInput: Bool
-
An image view to be added to the passcode screens.
This image view is to be displayed on the top center of passcode views and is typically the company logo image. Developer is expected to set the
image
property in order to display this image to the passcode views.- The image view will not be displayed if its
image
property is not set. - Developer can set the
imageViewSize
property to a specified size. Otherwise, the default size will be used whenimageViewSize
property isnil
.
Declaration
Swift
@MainActor public internal(set) var imageView: UIImageView { get }
- The image view will not be displayed if its
-
The size of the image view.
If this property is
nil
, the default size of 256 px width and 54 px height is used. Note that the the maximum width is limited to 256 px and the maximum height is limited to 54 px.Declaration
Swift
@MainActor public var imageViewSize: CGSize?
-
The flag indicating if the action button is on navigation bar or on the bottom of the passcode view.
The default value is
true
, which means the action button is on the navigation bar.Declaration
Swift
@MainActor public var isActionButtonOnNavigationBar: Bool
-
The
FUIPrivateEncryptionKeyGenerator
for thisFUIPasscodeChangeController
.A default implementation will be used if this is
nil
.Declaration
Swift
@MainActor public weak var privateEncryptionKeyGenerator: FUIPrivateEncryptionKeyGenerator?
-
The action button on the passcode view.
This button is to be shown only when
isActionButtonOnNavigationBar
isfalse
.Declaration
Swift
@MainActor public internal(set) var actionButton: FUIButton { get }
-
Creates a
FUIPasscodeChangeController
object from storyboard.Declaration
Swift
@MainActor public class func createInstanceFromStoryboard() -> FUIPasscodeChangeController
Return Value
A
FUIPasscodeChangeController
object.