Skip to content

Commit

Permalink
Fix tabs.
Browse files Browse the repository at this point in the history
  • Loading branch information
srdanrasic committed Jun 22, 2019
1 parent 2a67100 commit 77e8cff
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions Sources/Layout/Layoutless.swift
Original file line number Diff line number Diff line change
Expand Up @@ -362,25 +362,25 @@ extension LayoutProtocol where Node: UIView {

/// Stack an array of views in a stack view.
public func stack(_ views: [AnyLayout], axis: NSLayoutConstraint.Axis, spacing: CGFloat = 0, distribution: UIStackView.Distribution = .fill, alignment: UIStackView.Alignment = .fill, configure: @escaping (UIStackView) -> Void = { _ in }) -> Layout<UIStackView> {
return Layout { revertable in
let stackView = UIStackView()
stackView.axis = axis
stackView.spacing = spacing
stackView.distribution = distribution
stackView.alignment = alignment
views.forEach {
revertable.append($0.layout(in: stackView))
}
configure(stackView)
return stackView
}
return Layout { revertable in
let stackView = UIStackView()
stackView.axis = axis
stackView.spacing = spacing
stackView.distribution = distribution
stackView.alignment = alignment
views.forEach {
revertable.append($0.layout(in: stackView))
}
configure(stackView)
return stackView
}
}

/// Stack an array of views in a stack view.
public func stack(_ axis: NSLayoutConstraint.Axis, spacing: CGFloat = 0, distribution: UIStackView.Distribution = .fill, alignment: UIStackView.Alignment = .fill, configure: @escaping (UIStackView) -> Void = { _ in }) -> ((AnyLayout...) -> Layout<UIStackView>) {
return { (views: AnyLayout...) -> Layout<UIStackView> in
return stack(views, axis: axis, spacing: spacing, distribution: distribution, alignment: alignment,configure: configure)
}
return { (views: AnyLayout...) -> Layout<UIStackView> in
return stack(views, axis: axis, spacing: spacing, distribution: distribution, alignment: alignment, configure: configure)
}
}

// MARK: Grouping
Expand Down

0 comments on commit 77e8cff

Please sign in to comment.