Layout
public struct Layout : RectBasedLayout, Extensible
Main layout structure. Use his for positioning and filling in source rect (which can be constrained using RectBasedConstraint
constraints).
-
Declaration
Swift
public static func build(_ base: RectBasedLayout) -> Layout
-
Performing layout of given rect inside available rect. Attention: Apply layout for view frame using code as layout(rect: &view.frame,…) has side effect and called setFrame method on view.
Parameters
rect
Rect for layout
source
Available space for layout
-
Alignment part of main layout.
See moreDeclaration
Swift
public struct Alignment : RectBasedLayout
-
Filling part of main layout
See moreDeclaration
Swift
public struct Filling : RectBasedLayout
-
Layout behavior, that makes passed rect equally to space rect
Warning
Don’t use this layout in combination with other, this can lead to unexpected behavior.Declaration
Swift
static var equal: Layout { get }
-
Layout behavior, that makes passed rect equally to rect
Declaration
Swift
static func equal(_ value: CGRect) -> Layout
-
This layout do nothing. Use this if you create compound layout and you need begin with old frame
Warning
Be careful if you use it in layout block. Any parameters that won’t overrided for this, will have no effect for constraints.Declaration
Swift
static var nothing: Layout { get }
-
Convinience initializer similar CGRect initializer.
Declaration
Parameters
x
Horizontal alignment behavior
y
Vertical alignment behavior
width
Width filling behavior
height
Height filling behavior
-
Undocumented
Declaration
Swift
func with(height: Filling.Vertical) -> Layout
-
Undocumented
Declaration
Swift
func with(width: Filling.Horizontal) -> Layout
-
Undocumented
Declaration
Swift
func with(y: Alignment.Vertical) -> Layout
-
Undocumented
Declaration
Swift
func with(x: Alignment.Horizontal) -> Layout
-
Undocumented
Declaration
Swift
public static func left(_ space: PartialRangeFrom<CGFloat>) -> Layout
-
Undocumented
Declaration
Swift
public static func right(_ space: PartialRangeFrom<CGFloat>) -> Layout
-
Undocumented
Declaration
Swift
public static func bottom(_ space: PartialRangeFrom<CGFloat>) -> Layout
-
Undocumented
Declaration
Swift
public static func top(_ space: PartialRangeFrom<CGFloat>) -> Layout
-
Undocumented
Declaration
Swift
static func + (lhs: Layout, rhs: Layout) -> Layout