Skip to content

Commit

Permalink
Merge pull request #138 from Babylonpartners/joao/hotfix-toggle-item-…
Browse files Browse the repository at this point in the history
…spacing

Expose contentView spacing via Toggle builder
  • Loading branch information
NSMyself authored Apr 3, 2019
2 parents afebfb6 + c81f6cc commit 09a21db
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion BentoKit/BentoKit/Components/Toggle.swift
Original file line number Diff line number Diff line change
Expand Up @@ -137,14 +137,17 @@ extension Component.Toggle {
extension Component.Toggle {
public final class StyleSheet: BaseViewStyleSheet<View> {
public let text: LabelStyleSheet
public let spacing: CGFloat

public init(text: LabelStyleSheet) {
public init(text: LabelStyleSheet, spacing: CGFloat = 9) {
self.text = text
self.spacing = spacing
}

public override func apply(to view: Component.Toggle.View) {
super.apply(to: view)
text.apply(to: view.textLabel)
view.contentView.spacing = spacing
}
}
}
Expand Down

0 comments on commit 09a21db

Please sign in to comment.