Created
February 21, 2019 07:54
-
-
Save gwennguihal/3829c07c3026f49520c17e6cddf72a63 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //---- VerticalSpace.swift | |
| public typealias VerticalSpace = CGFloat | |
| public extension CGFloat { | |
| public static var zero: VerticalSpace = 0 | |
| public static var small: VerticalSpace = 5 | |
| public static var medium: VerticalSpace = 10 | |
| public static var big: VerticalSpace = 20 | |
| public static var huge: VerticalSpace = 40 | |
| } | |
| //---- Builder.swift | |
| // new propertie | |
| private(set) var verticalSpaces = [Int: VerticalSpace]() | |
| // new method | |
| public func add(verticalSpace: VerticalSpace) { | |
| let index = cells.indices.last ?? 0 | |
| verticalSpaces[index] = verticalSpace | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment