CreationKit Documentation

Class Badge

public final class Badge: UIView  

Badges are small status descriptors for UI elements. A badge consists of a small circle (or racetrack shape), typically containing a number that appears in proximity to another object.

Badges have two categories:

  • SystemDefault - background color red

  • Messages - background color blue

And two styles per category:

  • Circle - displays single digit numbers (< 10)

  • Racetrack - displays double digit numbers (>= 10)

The style of the batch changes automatically based on the value passed to the category

Badge Badge UIView UIView Badge->UIView

Nested Types

Badge.Category

Each style takes a value (Int) to be displayed

Conforms To

UIView

Initializers

init(category:​)

public init(category: Category)  

Creates a new Badge with a Style.

Prefer to use make(category:) instead.

Parameters

category Category

The category of the badge: defines the color

Properties

value

public var value: Int = 0  

Methods

make(category:​)

public static func make(category: Category) -> Badge  

Creates a new Badge with a Style.

Parameters

category Category

The category of the badge: defines the color