Skip to content

Instantly share code, notes, and snippets.

@gwennguihal
Created February 21, 2019 07:54
Show Gist options
  • Save gwennguihal/3829c07c3026f49520c17e6cddf72a63 to your computer and use it in GitHub Desktop.
Save gwennguihal/3829c07c3026f49520c17e6cddf72a63 to your computer and use it in GitHub Desktop.
//---- 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