BankIdViewController

The BankIdViewController is a subclass of BaseViewController and is themed with BankIdViewControllerStyle. This view controller handles PollingModel.

UI structure

The root structure is composed of a StackView that contains the following elements.

Name Description
bankIdImageView An ImageView that represents the bankID logo.
bankIdStackView A stackView that holds the progressBar, countLabel, expandableView, orLabel and cancelButton.
cancelButton A cancel button.
countLabel A label that represents the remaining time for the poling.
expandableView An expandable view for bankID instructions.
orLabel A visual separator label displaying ‘OR’ to indicate an alternative flow or action.
progressBar A progress bar for the polling.

The view hierarchy is structured from top to bottom as follows:

Overriding translation text

BankIdViewController uses the following string resources for all user-facing text.

You can override these keys in your application’s Theme.plist to customize the wording or provide localized translations.

⚠️ Make sure to preserve formatting placeholders (e.g. %s) when overriding values.

Resource Key Description Default value
hui_bankid_instruction_body_1 Instruction text shown for the first step in the BankID authentication flow. See default text below
hui_bankid_instruction_title_1 Title for the first instruction step in the BankID authentication flow. Help with scanning the QR code
hui_polling_minutes Displays a duration in minutes. %d minute / %d minutes
hui_polling_minutes_remaining Displays remaining time in minutes and seconds. %d minute and %d seconds remaining / %d minutes and %d seconds remaining
hui_or Text displayed between alternative options. Or
hui_polling_seconds Displays a duration in seconds. %d second / %d seconds
hui_polling_seconds_remaining Displays remaining time in seconds. %d second remaining / %d seconds remaining

Default Instruction Body (hui_bankid_instruction_body_1)

• Open the BankID app\n
• Press the Scan QR code button\n
• Point your phone\'s camera at the QR code\n
• Follow the instructions in the app\n\n

The QR code is displayed for %@, then identification is canceled for security reasons. You can then try again. Make sure the entire QR code fits on the screen, otherwise it cannot be scanned.

Important

Modifying the UI structure

It is possible to remove or add any elements in the root structure.

To remove an existing element, invoke removeFromSuperview() for the selected element.

To add a new view, invoke one of the following methods:

Subclassing

When subclassing and instantiating your new view controller, a ThemeRegistry and a corresponding UIModel are required for the super constructor.

class CustomBankIdViewController: BankIdViewController {
    init(model: PollingModel, themeRegistry: ThemeRegistry) {
        super.init(model: model, themeRegistry: themeRegistry)
        // Your implementation
    }
  
  	// Your custom implementation
}