LogoView
LogoView is a wrapper component for displaying company logos with support for square and wide variants, as well as automatic dark and light mode adaptation.
Platform availability: iOS 17.0+
When to use:
- Use LogoView when displaying your bank or company logo with automatic dark/light mode adaptation.
- Consider using a custom implementation when you need logo handling outside the design system's asset management.
It includes the following features:
- Six different logo types for various use cases.
- Automatic dark/light mode image switching.
- Configurable content mode for the underlying image view.
- Built-in accessibility support.
Import
import BackbaseDesignSystem
Visual reference
|
|
|
|
API reference
LogoView
Initializers
|
Initializer |
Description |
|---|---|
|
init(type: LogoType, contentMode: UIImageView.ContentMode) |
Creates a logo view with the specified type and content mode. Content mode defaults to .scaleAspectFit |
LogoType Enum
|
Case |
Description |
Asset |
|---|---|---|
|
square |
Square logo with automatic dark/light mode switching |
DesignSystem.Assets.appLogoSquare |
|
squareDark |
Square logo always showing dark mode variant |
DesignSystem.Assets.appLogoSquareDark |
|
squareLight |
Square logo always showing light mode variant |
DesignSystem.Assets.appLogoSquareLight |
|
wide |
Wide logo with automatic dark/light mode switching |
DesignSystem.Assets.appLogoWide |
|
wideDark |
Wide logo always showing dark mode variant |
DesignSystem.Assets.appLogoWideDark |
|
wideLight |
Wide logo always showing light mode variant |
DesignSystem.Assets.appLogoWideLight |
Configuration
|
Property |
Type |
Default |
|---|---|---|
|
contentMode |
UIImageView.ContentMode |
.scaleAspectFit |
|
type |
LogoType |
Required |
type
The type property determines which logo variant to display.
// Square logo with automatic dark/light mode
let squareLogo = LogoView(type: .square)
// Wide logo with automatic dark/light mode
let wideLogo = LogoView(type: .wide)
// Force dark mode variant
let darkLogo = LogoView(type: .squareDark)
contentMode
The contentMode property controls how the logo image fills its bounds.
// Default aspect fit
let logo = LogoView(type: .square)
// Fill the entire bounds
let filledLogo = LogoView(type: .square, contentMode: .scaleToFill)
Usage
Basic usage
let logoView = LogoView(type: .square)
view.addSubview(logoView)
With custom content mode
let logoView = LogoView(type: .square, contentMode: .scaleToFill)
view.addSubview(logoView)
Setting constraints
let squareLogo = LogoView(type: .square)
NSLayoutConstraint.activate([
squareLogo.heightAnchor.constraint(equalToConstant: 40),
squareLogo.widthAnchor.constraint(equalTo: squareLogo.heightAnchor, multiplier: 1),
])
view.addSubview(squareLogo)
Wide logo with recommended size
let wideLogo = LogoView(type: .wide)
NSLayoutConstraint.activate([
wideLogo.heightAnchor.constraint(equalToConstant: 40),
wideLogo.widthAnchor.constraint(equalToConstant: 120),
])
view.addSubview(wideLogo)
Customization
Overriding logo assets
To override the Backbase logo with your own bank's logo, add your logo PDF assets to your Xcode project's .xcassets in your main app bundle.
The asset names should match:
- app-logo-square
- app-logo-square-light
- app-logo-square-dark
- app-logo-wide
- app-logo-wide-light
- app-logo-wide-dark
For app-logo-wide and app-logo-square, set:
- Scales: Single Scale
- Appearances: Any, Dark
For the remaining four assets, set:
- Appearances: None
Accessibility
This component is built with accessibility in mind. See the information below for supported behaviors and configuration options to ensure a fully accessible experience for all users.
Accessibility configuration
|
Property |
Description |
Type |
|---|---|---|
|
accessibilityLabel |
The accessible label for the logo image |
String |
|
isAccessibilityElement |
Whether the logo is an accessibility element |
Bool |
Best practices
- The component automatically sets the accessibility label using DesignSystem.Strings.LogoView.Accessibility.logo.
- The default localized value is "Bank logo".
- To change the accessibility label, modify the localized string in your Localizable.strings file.
// Default accessibility label is set automatically
let logo = LogoView(type: .square)
// Override accessibility label if needed
logo.accessibilityLabel = "Your Bank Name"
Dependencies
- External dependencies: None
- Internal dependencies: DesignSystem.Assets
Design tokens
Component styling is applied automatically through the design system's theming infrastructure.
JSON tokens
This component uses semantic tokens only. See Semantic tokens below.
Semantic tokens
These tokens are accessed via the public DesignSystem.shared API.
|
Token |
API Reference |
Description |
|---|---|---|
|
Assets |
DesignSystem.Assets.appLogoSquare |
Square logo with dark/light mode switching |
|
Assets |
DesignSystem.Assets.appLogoSquareDark |
Square logo dark variant |
|
Assets |
DesignSystem.Assets.appLogoSquareLight |
Square logo light variant |
|
Assets |
DesignSystem.Assets.appLogoWide |
Wide logo with dark/light mode switching |
|
Assets |
DesignSystem.Assets.appLogoWideDark |
Wide logo dark variant |
|
Assets |
DesignSystem.Assets.appLogoWideLight |
Wide logo light variant |
Localization
The following strings are available for localization:
|
Key |
Default Value |
Description |
|---|---|---|
|
DesignSystem.logoView.accessibility.logo |
"Bank logo" |
Accessibility label for the logo |
To customize these strings, add the keys to your app's Localizable.strings file.
See also
- Logos - Overview of available logo assets