ArtboardRepresentable
public protocol ArtboardRepresentable
Conform your UIView to this protocol to easily create an Artboard for your example views
Provide example views using the artboardElements() method and create an artboard by calling makeArtboard(origin:)
-
The only required method that needs to be implemented Returns vertical stacks of ArtboardElements
Declaration
Swift
static func artboardElements() -> [[ArtboardElement]] -
nameDefault implementationName of the artboard.
Default Implementation
Defaults to the name of self
Declaration
Swift
static var name: String { get } -
viewWidthDefault implementationFixed width to use for views provided in artboardElements() Set to nil to have the view be self sized
Default Implementation
Defaults to the screen width
Declaration
Swift
static var viewWidth: CGFloat? { get } -
artboardInsetsDefault implementationInsets to the edges of the artboard
Default Implementation
Defaults to .zero
Declaration
Swift
static var artboardInsets: UIEdgeInsets { get } -
artboardSpacingDefault implementationSpacing between artboard elements
Default Implementation
Defaults to 8
Declaration
Swift
static var artboardSpacing: CGFloat { get } -
artboardColorDefault implementationBackground color of the artboard
Default Implementation
Defaults to #F5F5F5
Declaration
Swift
static var artboardColor: Color { get } -
makeArtboard(origin:)Default implementationGenerates an
Artboardcontaining examples of the conforming typeDefault Implementation
Creates an artboard using the elements provided in
artboardElements().Views provided in
artboardElements()will be automatically laid outEach set of
ArtboardElementwill be stacked vertically inside theArtboardDeclaration
Swift
static func makeArtboard(origin: CGPoint) -> Artboard
ArtboardRepresentable Protocol Reference