FUIMultiUserPasscodeController
@MainActor
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.imagelogoImageViewSizetitleLabel.textdataSourcedelegate
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
imageproperty in order to display this image to the passcode views.- The image view will not be displayed if its
imageproperty is not set. - Developer can use the
logoImageViewSizeproperty to a specified size. Otherwise, the default size will be used.
Declaration
Swift
@MainActor public let logoImageView: UIImageView - The image view will not be displayed if its
-
The size of the logo image view.
The default size of 256 px width and 54 px height is used.
Declaration
Swift
@MainActor public var logoImageViewSize: CGSize -
The label for the title.
The title is usually the name of the app.
Declaration
Swift
@MainActor public let titleLabel: FUILabel -
This image view contains the image of the user.
This image view will be displayed If property
showsUserImageistrue.A image with user name initials will be displayed if the dataSource does not provide an image for the current user.
Declaration
Swift
@MainActor public let userImageView: FUIImageView -
The label for the user name.
Declaration
Swift
@MainActor public let userNameLabel: FUILabel -
The label for other user info to be displayed.
This label will be displayed if property
showsUserInfoistrue.This is usually the email address or employee ID.
Declaration
Swift
@MainActor public let userInfoLabel: FUILabel -
The input field for user to enter the passcode.
Declaration
Swift
@MainActor public let passcodeInputField: FUITextField -
The label for the error message when user entered wrong passcode.
Developers can use
FUIPasscodeController‘s static propertiesretryPasscodeMessageString,attemptsLeftMessageFormat,oneAttempLeftMessageFormat, andmaxAttemptsReachedMessageStringto customize the error messages for this label.Declaration
Swift
@MainActor public let errorMessageLabel: FUILabel -
The “Log In” button.
The delegate’s
shouldTryPasscodefunction will be invoked when this button is tapped.Declaration
Swift
@MainActor public let logInButton: FUIButton -
The label with “Forgot passcode?”.
The delegate’s
shouldResetPasscodefunction will be invoked when this label is tapped.Declaration
Swift
@MainActor 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
@MainActor public let switchUserButton: FUIButton -
This is the
UIBarButtonItemon the navigation bar of the user selection view.When this is tapped, the delegate’s
addNewUserfunction will be invoked.Declaration
Swift
@MainActor 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
@MainActor 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
@MainActor open var showsUserImage: Bool -
If this property is true, the user information label will be displayed.
When this property is true, the
userInfoLabelwill be displayed, even if theinfoStringproperty of the user isnil.The default is true.
Declaration
Swift
@MainActor 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
shouldTryPasscodeis derived from the user passcode. The default isfalse.Declaration
Swift
@MainActor 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
didCancelPasscodeEntryfunction of the delegate is invoked. The default is false.Declaration
Swift
@MainActor public var showsCancelBarItem: Bool