Skip to content

Latest commit

 

History

History
39 lines (23 loc) · 929 Bytes

README.md

File metadata and controls

39 lines (23 loc) · 929 Bytes

Backpack/Label

Usage

BPKLabel/Backpack.Label contains the Backpack Label component which is a subclass of UILabel with Skyscanner styles. It accepts a Backpack font style to set the desired size.

Objective-C

#import <Backpack/Label.h>

BPKLabel *label = [[BPKLabel alloc] initWithFontStyle:BPKFontStyleTextBase];
// Position label with autolayout or other method

// Set font style for a specific range
[label setFontStyle:BPKFontStyleTextLg range:NSMakeRange(12, 10)];

Swift

import Backpack

let label = Backpack.Label(fontStyle: .base)
// Position label with autolayout or other method

// Set font style for a specific range
label.setFontStyle(.textLg, range: NSRange(location: 12, length: 10))

Dynamic Text

BPKLabel doesn't currently support Dynamic Text, but this is planned for a later release.

Appearance attributes

(BPKFontMapping)fontMapping