Switch

Switches allow users to toggle between two states, on or off. On mobile, these are often used as a replacement for checkboxes.

Backpack/Switch

class reference view on Github

Default

Day Night

Usage

BPKSwitch contains the Backpack Switch component which is a subclass of UISwitch with Skyscanner styles.

Objective-C


                                                
                                                #import <Backpack/Switch.h>
                                                
                                                BPKSwitch *switch = [BPKSwitch new];
                                                // Position switch with autolayout or other method

Swift


                                                
                                                import Backpack
                                                
                                                let `switch` = BPKSwitch();
                                                // Position switch with autolayout or other method

Appearance attributes

  • (UIColor)onTintColor