Design System
  • Get started
    • Figma
    • Web
    • iOS
    • Android
  • Design tokens
    • Primitive colors
    • Semantic colors
      • Background Colors
      • On Background Colors
      • Foreground Colors
      • Border Colors
      • Focus Colors
      • Link Colors
    • Migration in iOS
    • Migration in android
    • Migration in web
    • Migration in figma
      • Step 1 Theme Migration
      • Step 2 Library Migration
      • Step 3 Journey Migration
    • Value & cost of migration
    • Deprecated tokens
  • Theme
    • Global branding
    • Component styling
    • Illustration theming
    • Exporting guide
    • Apply a theme on android
    • Apply a theme on iOS
    • Apply a theme on web
    • Multi theming on android
    • Multi theming on iOS
    • Multi theming on web
    • Before 2024 09
      • Create A Theme
      • Apply A Theme On Android
      • Apply A Theme On iOS
      • Apply A Theme On Web
      • Multi Theming On Android
      • Multi Theming On iOS
      • Multi Theming On Web
  • Accessibility
    • Overview
    • Designer checklist
    • Developer checklist
  • Guides
    • Custom icons on web
    • Beta ui ang with cursor
  • Web components
    • Account number
    • Account selector
    • Alert
    • Amount
    • Animations
      • Cross Journey
      • In Journey
      • Expand Reveal
      • Scroll Service
    • Avatar
    • Badges
      • Badge
      • Badge Counter
    • Button
    • Card vendor
    • Chip
    • Collapsibles
      • Collapsible
      • Collapsible Card
      • Collapsible Accordion
    • Money protection
      • Status
      • Disclaimer
      • Banner
    • Dropdowns
      • Dropdown Menu
      • Dropdown Single Select
      • Dropdown Multi Select
      • Dropdown Panel
    • Ellipsis
    • File attachment
    • Forms
      • Amount Input
      • Input Checkbox
      • Checkbox Group
      • Currency Input
      • Input Datepicker
      • Input Email
      • Fieldset
      • Input Inline Edit
      • List Multiple Select
      • Input Phone
      • Input Password
      • Input Radio Group
      • Input Range
      • Switch
      • Select List
      • Input Timepicker
      • Input Text
      • Textarea
      • Input Validation
      • Input File
      • Input Number
    • Icon
    • Illustration
    • Infinite scroll
    • Item log
    • Layouts and navigation
      • Horizontal Layout
      • Vertical Layout
    • Keyboard click directive
    • Loaders
      • Loading Indicator
      • Load Button
    • Locale selector
    • Logo
    • Modal
    • Mode header
    • Notification
    • Option list
    • Pagination
    • Page header
    • Payment card
    • Period selector
    • Product items
      • Basic Account
      • Savings Account
      • Current Account
      • Investment Account
      • Credit Card
      • Debit Card
      • Loan
      • Term Deposit
    • Product selector
    • Progress tracker
    • Progressbar
    • Rich text editor
    • Search box
    • States
      • Action Status
      • Empty State
      • Common Error State
    • Stepper
    • Css utilities
      • Bb Block
      • Bb Button Bar
      • Bb Card
      • Bb Container
      • Bb Display
      • Bb Inline Stack
      • Bb Layout Horizontal Navigation
      • Bb Layout Horizontal
      • Bb Layout
      • Bb Stack
      • Bb State Container
      • Bb Tabs Container
      • Bb Toolbar
      • Bb Vertical Tabs Container
    • Tab
    • Table
    • Tooltip
    • Tracker
    • Value diff
    • Universal header
  • Web formatters
    • Account number
    • Date
    • IBAN
    • Payment card number
    • Phone number
  • Mobile components
    • Alert
    • Amount
    • Async emblem
    • Avatar
    • Badge
    • Badge counter
    • Button
    • Button group
    • Card
    • Chip
    • Emblem
    • Floating action button
    • Forms
      • Address Form
      • Address Preview
      • Country Selector
      • Amount Input
      • Checkbox
      • Datepicker
      • Form Label
      • Phone Input
      • Password Input
      • Switch
      • Text Area
      • Text Input
    • Icon
    • Loading indicator
    • Link
    • Logo view
    • Navigation controller
    • Page control
    • Payment card
    • Product number display formatter
    • Progress bar
    • Separator
    • Search bar
    • Shimmer view
    • Slider
    • Snackbar
    • State view
    • Summary stack
    • Tab header
    • Toggle button

IOSUIKit

Available from 2.5.0

AddressForm

Overview

AddressForm is a component that enables users to enter a postal address in a standardized way. It can optionally be configured to interface with an address verification and autocompletion service, for example Smarty.

You can use the form to capture a new address, or edit an existing one.

AddressForm provides the following:

  • Input fields for up to eight fields of address information.
  • Configurable order and presence for each field.
  • A drop-down input field to select between states and country sub-divisions.
  • An address autocompletion screen where users can select from a drop-down list of addresses suggested by an external service.
  • Text and style configurability.

Visual reference

Address form without an autocomplete component
Address form with autocomplete component
The address autocomplete screen

Usage

Initialize AddressForm using AddressFormFactory and AddressFormConfiguration.

When the form is initialized using an existing address, it is configured to edit the address. If no address is provided, the bank customer can provide a new address.

You can also use AddressSuggestionConfiguration to include an address autocomplete component that enables the user to type a partial address and select the correct address from the suggestions provided.

Add an address form to your view

The AddressForm component is provided as a view controller and must be included within your view as a child view controller. The following is a simple example of how it can be configured:

private lazy var states = [
    (abbreviation: "AK", name: "Alaska"),
    (abbreviation: "AL", name: "Alabama"),
    (abbreviation: "AR", name: "Arkansas"),
    (abbreviation: "AS", name: "American Samoa"),
    (abbreviation: "AZ", name: "Arizona"),
    (abbreviation: "CA", name: "California")
]

private lazy var formConfiguration: AddressFormConfiguration = {
    .init(strings: .init(address1InputTitle: "Street address",
                         address2InputTitle: "Apartment or suite",
                         cityInputTitle: "Town/City",
                         stateInputTitle: "State",
                         stateInputPlaceholder: "Select a state",
                         zipInputTitle: "ZIP Code",
                         searchInputPlaceholder: "Start typing your address"),
         availableStates: states)
}()

private lazy var addressFormController: AddressForm = {
    AddressFormFactory.build(formConfiguration: formConfiguration)
}()

override func loadView() {
    ...

    view.addSubview(addressFormController.view)

    addChild(addressFormController)
    addressFormController.didMove(toParent: self)
}

You can also configure the form to edit an existing address as follows:

struct MyAddressType: AddressFormValues {
    ...
}

private lazy var addressFormController: AddressForm = {
    AddressFormFactory.build(formConfiguration: formConfiguration,
                             address: myAddress)
}()

The Address Form contains of five address fields, and another three extra fields are hidden by default. The order and presence can be customised by providing visibleFields array in configuration. There is a possibility to put two fields in one row by wrapping them into a compound:

private lazy var addressFormController: AddressFormConfiguration = {
    let visibleFields: [AddressField] = [
            .addressLine1,
            .addressLine2,
            .city,
            .compound(.subDivision, .zip),
            .extra1,
            .extra2,
            .extra3
        ]
    return AddressFormConfiguration(strings: addressFormStrings,
                                    availableSubDivisions: sortedStates,
                                    visibleFields: visibleFields)
}()

Support autocomplete

To use the address autocomplete functionality, you must configure AddressSuggestionConfiguration and implement AddressSearchResultsProvider. This implementation interfaces to an external service that returns a list of suggested addresses for a given search term. The address suggestion is incomplete if there is more than one entry in it, and it can be used to find all it's secondary addresses (apartments, suites). If user selects the suggestion with entries the Address Form wouldn't be populated. Instead corresponding request would be sent, and the secondary addresses would replace search results.

class AddressService: AddressSearchResultsProvider {
    func search(query: String, completion: @escaping (AddressAutocompleteResult) -> Void) {
        ...
    }

    func searchApartments(selection: AddressSuggestion, query: String, completion: @escaping AddressSuggestionCompletion) {
        ...
    }
}

...

let suggestionProvider = AddressService()

private lazy var suggestionConfiguration: AddressSuggestionConfiguration = {
    .init(suggestionProvider: suggestionProvider,
          strings: .init(addressNotFound: "Address not found? Enter manually",
                         searchBarPlaceholder: "Start typing your address"))
}()

private lazy var addressFormController: AddressForm = {
    AddressFormFactory.build(formConfiguration: formConfiguration,
                             suggestionConfiguration: suggestionConfiguration
}

Styling

The following shared styles are used with the address form:

  • DesignSystem.shared.styles.textInput
  • DesignSystem.shared.styles.searchInput

The following shared styles are used on the autocomplete screen:

  • DesignSystem.shared.styles.searchBar
  • DesignSystem.shared.styles.tableView
  • DesignSystem.shared.styles.tableViewCell
  • DesignSystem.shared.styles.tableViewLinkCell
On this page
Overview
Visual Reference
Usage
Styling
©2025 All rights reserved
Terms and LegalPrivacy Policy

Cookies on Backbase

This website uses cookies to enhance your browsing experience, analyze the traffic, and for marketing purposes. All Google Analytics cookies are anonymized. By clicking 'Accept' you accept the use of all cookies as described in our privacy-statement.