FUIMultiUserPasscodeController

open class FUIMultiUserPasscodeController : FUIPasscodeController
extension FUIMultiUserPasscodeController: FUIListPickerDataSource
extension FUIMultiUserPasscodeController: FUIListPickerSearchResultsUpdating
extension FUIMultiUserPasscodeController: UITextFieldDelegate

This passcode controller is for login to an app that supports multiple users.

The following properties needs to be set Before the navigation controller presents this FUIMultiUserPasscodeController:

  • logoImageView.image
  • logoImageViewSize
  • titleLabel.text
  • dataSource
  • delegate

A typical usage is as the sample code below:

        let passcodeController = FUIMultiUserPasscodeController()

        passcodeController.logoImageView.image = UIImage(named: "CompanyLogo", in: bundle, with: nil)
        passcodeController.logoImageView.contentMode = .scaleAspectFit
        passcodeController.logoImageViewSize = CGSize(width: 54, height: 27)
        passcodeController.titleLabel.text = "Company App"
        passcodeController.dataSource = self
        passcodeController.delegate = self

        let navigationController = UINavigationController(rootViewController: passcodeController)
        navigationController.modalPresentationStyle = .fullScreen
        navigationController.modalTransitionStyle = .coverVertical
        self.present(navigationController, animated: true, completion: nil)

Theming

Supported fixed font UILabel class paths:

fdlFUIMultiUserPasscodeController_titleLabel
fdlFUIMultiUserPasscodeController_userNameLabel
fdlFUIMultiUserPasscodeController_userInfoLabel
fdlFUIMultiUserPasscodeController_errorMessageLabel
fdlFUIMultiUserPasscodeController_forgotPasscodeLabel

Supported fixed font UILabel properties:

font-size: (Size)
font-name: (Font Name)
font-color: (Color)

Supported UITextField class paths:

fdlFUIMultiUserPasscodeController_passcodeInputField

Supported UITextField properties:

border-color: (Color)
border-width: (Width)
corner-radius: (Radius)
font-color: (Color)

Supported UIButton class paths:

fdlFUIMultiUserPasscodeController_logInButton
fdlFUIMultiUserPasscodeController_switchUserButton

Supported UIButton properties:

background-color { -normal | -disabled }: (Color)
font-size: (Size)
font-name: (Font Name)
font-color { -disabled }: (Color)

Supported UIBarButtonItem class paths:

fdlFUIMultiUserPasscodeController_addNewUserBarButtonItem

Supported UIBarButtonItem properties:

image: (Image Name)
background-tint-color: (Color)

Supported ImagePlaceholder class paths:

fdlFUIMultiUserPasscodeController_userImagePlaceholder
fdlFUIMultiUserPasscodeControllerUserCell_imagePlaceholder

Supported ImagePlaceholder properties:

font-size: (Size)
font-name: (Font Name)
font-color: (Color)

Supported ImagePlaceholderView class paths:

fdlFUIMultiUserPasscodeController_userImagePlaceholderView
fdlFUIMultiUserPasscodeControllerUserCell_imagePlaceholderView

Supported ImagePlaceholderView properties:

background-color: (Color)

Supported dynamic font UILabel class paths:

fdlFUIMultiUserPasscodeControllerUserCell_titleLabeldlFUIMultiUserPasscodeController_titleLabel
fdlFUIMultiUserPasscodeControllerUserCell_subtitleLabel

Supported dynamic font UILabel properties:

font-style: (Font Style)
font-color: (Color)
  • An image view to be displayed in the multi-user passcode screen for company logo.

    This image view is to be displayed on the top center of the passcode screen. 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 use the logoImageViewSize property to a specified size. Otherwise, the default size will be used.

    Declaration

    Swift

    public let logoImageView: UIImageView
  • The size of the logo image view.

    The default size of 256 px width and 54 px height is used.

    Declaration

    Swift

    public var logoImageViewSize: CGSize
  • The label for the title.

    The title is usually the name of the app.

    Declaration

    Swift

    public let titleLabel: FUILabel
  • This image view contains the image of the user.

    This image view will be displayed If property showsUserImage is true.

    A image with user name initials will be displayed if the dataSource does not provide an image for the current user.

    Declaration

    Swift

    public let userImageView: FUIImageView
  • The label for the user name.

    Declaration

    Swift

    public let userNameLabel: FUILabel
  • The label for other user info to be displayed.

    This label will be displayed if property showsUserInfo is true.

    This is usually the email address or employee ID.

    Declaration

    Swift

    public let userInfoLabel: FUILabel
  • The input field for user to enter the passcode.

    Declaration

    Swift

    public let passcodeInputField: FUITextField
  • The label for the error message when user entered wrong passcode.

    Developers can use FUIPasscodeController‘s static properties retryPasscodeMessageString, attemptsLeftMessageFormat, oneAttempLeftMessageFormat, and maxAttemptsReachedMessageString to customize the error messages for this label.

    Declaration

    Swift

    public let errorMessageLabel: FUILabel
  • The “Log In” button.

    The delegate’s shouldTryPasscode function will be invoked when this button is tapped.

    Declaration

    Swift

    public let logInButton: FUIButton
  • The label with “Forgot passcode?”.

    The delegate’s shouldResetPasscode function will be invoked when this label is tapped.

    Declaration

    Swift

    public let forgotPasscodeLabel: FUILabel
  • This button is to be used when the user wants to log in as another user.

    The screen will transition to display a list and a “Add New User” button. User can then choose from a list of onboarded users, or tap the button to onboard a new user.

    Declaration

    Swift

    public let switchUserButton: FUIButton
  • This is the UIBarButtonItem on the navigation bar of the user selection view.

    When this is tapped, the delegate’s addNewUser function will be invoked.

    Declaration

    Swift

    public private(set) var addNewUserBarButtonItem: FUIBarButtonItem! { get }
  • TThis is the data source for providing the list of onboarded users for the app on the device.

    Declaration

    Swift

    open weak var dataSource: FUIMultiUserPasscodeControllerDataSource? { get set }
  • If this property is true, the user image view will be displayed.

    When this property is false, the user image view will not be displayed, even if the user has an associated image. When this property is true, even if the user does not have an associated image, there will be a circular image displayed with user name initials.

    The default is true.

    Declaration

    Swift

    open var showsUserImage: Bool
  • If this property is true, the user information label will be displayed.

    When this property is true, the userInfoLabel will be displayed, even if the infoString property of the user is nil.

    The default is true.

    Declaration

    Swift

    open var showsUserInfo: 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 is false.

    Declaration

    Swift

    public var hashUserPasscode: Bool
  • If this property is true, a Cancel bar button item will be displayed.

    When the Cancel bar button item is tapped, the didCancelPasscodeEntry function of the delegate is invoked. The default is false.

    Declaration

    Swift

    public var showsCancelBarItem: Bool