CreationKit Documentation

Class Checkbox​Layout

public final class CheckboxLayout: NSObject, ComponentLayout  

The ComponentLayout to make a Checkbox. You usually won't need to use this directly, prefer to use Checkbox instead.

CheckboxLayout CheckboxLayout NSObject NSObject CheckboxLayout->NSObject ComponentLayout ComponentLayout CheckboxLayout->ComponentLayout

Conforms To

ComponentLayout

A protocol to share components (view layouts) across different types.

NSObject

Properties

on​Color

public var onColor: UIColor = ColorManager.Primary.threeHundred

The color of the on state

off​Color

public var offColor: UIColor = .white

The color of the off state

on​Border​Color

public var onBorderColor: UIColor = .clear

The border color of the on state

off​Border​Color

public var offBorderColor: UIColor = ColorManager.Neutral.fourHundred

The border color of the off state

image​Color

public var imageColor: UIColor = .white  

The color of the image in the checkbox (Only displayed while in the on state)

animation​Duration

public var animationDuration: TimeInterval = 0.25

The duration of the toggle animation. Set to 0 to disable animations.

Methods

layout(on:​)

public func layout(on view: UIView)  

update(is​On:​animate​Background:​)

public func update(isOn: Bool, animateBackground: Bool = true)  

Updates the state of the layout and performs animations.