Skip to content

Commit 4c0b8bc

Browse files
committed
enhance alignment fillWidth/fillHeight can custom set spacing for those
1 parent 2ba79cf commit 4c0b8bc

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

Demo/Demo/HVStackDemoViewController.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class HVStackDemoViewController: UIViewController {
4242

4343
Spacer()
4444

45-
VStackView(distribution: .fillWidth(10)) {
45+
VStackView(distribution: .fillWidth(spacing: 10)) {
4646

4747
// view.stack.then (Inspired by Then [ https://github.com/devxoul/Then ])
4848
UILabel().stack.then { label in

Demo/Demo/WrapStackDemoViewController.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class WrapStackDemoViewController: UIViewController {
1515

1616
// Do any additional setup after loading the view.
1717

18-
let vStack = VStackView(distribution: .fillWidth(10)) {
18+
let vStack = VStackView(distribution: .fillWidth(spacing: 10)) {
1919
UILabel().stack.then {
2020
$0.text = "StackKit"
2121
$0.font = .systemFont(ofSize: 18, weight: .semibold)

Sources/StackKit/Enums.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public enum HStackDistribution {
1717

1818
/// The height of subviews are equal. `The height of the VStack needs to be given.`
1919
/// set `nil` means autoSpacing
20-
case fillHeight(_ spacing: CGFloat? = nil)
20+
case fillHeight(spacing: CGFloat? = nil)
2121

2222
/// The width and height of subviews are equal. `The size of the HStack needs to be given.`
2323
case fill
@@ -41,7 +41,7 @@ public enum VStackDistribution {
4141

4242
/// The widths are all equal. `The width of the VStack needs to be given.`
4343
/// set `nil` means autoSpacing
44-
case fillWidth(_ spacing: CGFloat? = nil)
44+
case fillWidth(spacing: CGFloat? = nil)
4545

4646
/// The widths and heights are all equal. `The size of the V Stack needs to be given.`
4747
case fill

0 commit comments

Comments
 (0)