NatBadge
public final class NatBadge : UIView
This component is available in the following variants:
- ✅ Standard
- ✅ Dot
- ✅ Pulse
With the following attributes:
- Color:
- ✅
Alert
- ✅
Primary
- ✅
Secondary
- ✅
Success
- ✅
- Limit:
- ✅
max9
- ✅
max99
- ✅
unlimited
- ✅
NatBadge is a class that represents a component from the Design System.
The badge colors change according to the current brand configured in the Design System. They also change according to the user’s properties of Light and Dark mode.
NatBadge has three variants: standard
, dot
and pulse
.
It can be configured with colors alert
, primary
, secondary
and success
.
Example of usage:
let badge = NatBadge(style: .standard, color: .alert)
badge.configure(limit: .unlimited)
Requires
It’s necessary to configure the Design System with a theme or fatalError will be raised.
DesignSystem().configure(with: AvailableTheme)
-
Undocumented
Declaration
Swift
public init(style: Style, color: Color, theme: AvailableTheme = .none)
-
Undocumented
Declaration
Swift
override public func draw(_ rect: CGRect)
-
Undocumented
Declaration
Swift
public func configure(count: Int)
-
Undocumented
Declaration
Swift
public func configure(limit: Limit)
-
Color is a enum that represents color values for the NatBadge component.
These are the allowed colors for a NatBadge:
- Alert
- Primary
- Secondary
Success
Requires
It’s necessary to configure the Design System with a theme or fatalError will be raised.
DesignSystem().configure(with: AvailableTheme)
See moreDeclaration
Swift
public enum Color
-
Limit is a enum that represents limits values for the NatBadge component.
These are the allowed limits for a NatBadge:
- max9: if the value exceeds 9, it shows 9+
- max99: if the value exceeds 99, it shows 99+
unlimited: it shows the exact set value
Requires
It’s necessary to configure the Design System with a theme or fatalError will be raised.
DesignSystem().configure(with: AvailableTheme)
Declaration
Swift
public enum Limit
-
Style is a enum that represents style values for the NatBadge component.
These are the allowed styles for a NatBadge:
- Standard
Dot
Requires
It’s necessary to configure the Design System with a theme or fatalError will be raised.
DesignSystem().configure(with: AvailableTheme)
Declaration
Swift
public enum Style