UINavigationController
public extension UINavigationController
This is an extension that modifies the navigationBar according to the Design System. It represents the component AppBar - Top.
Note
This component is available in the following variants:- ✅ Standard
- ⚠️ Base
With the following attribute status:
- ✅ Action right
- ✅ Action left
- Color:
- ✅
Default
- ✅
Primary
- ✅
None
- ✅
Inverse
- ✅
- Elevation:
- ✅
True
- ✅
False
- ✅
- Content position:
- ✅
Center
(default) - ⚠️
Left
- ✅
- Content type:
- ✅
Text
- ✅
Media
- ⚠️
Search
- ✅
- Content proeminent:
- ✅
False
(default) - ⚠️
True
- ✅
- Behavior:
- ✅
Fixed
(default) - ⚠️
Scroll
- ✅
The navigation bar colors change accordint to the current brand configured and to the light/dark mode properties.
The component is available only with the variant standard
.
Examples of usage:
navigationController.configure(color: .primary)
navigationController.configure(elevation: true)
Requires
It’s necessary to configure the Design System with a theme or fatalError will be raised.
DesignSystem().configure(with: AvailableTheme)
-
Sets the color for navigation bar and its subviews
Declaration
Swift
func configure(appBarColor: AppBarColor, appBarContentType: AppBarContentType = .text(""))
Parameters
color
an option from
AppBarColor
enum -
Sets an elevation for the navigation bar, which adds a slight shadow to it
Declaration
Swift
func configure(appBarElevation: Bool)
Parameters
elevation
a boolean to add or remove the attribute