Skip to content

Commit

Permalink
Fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
tevelee committed Jun 26, 2024
1 parent fd38a57 commit c5c47e8
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 29 deletions.
8 changes: 4 additions & 4 deletions Sources/Flow/Example/ContentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ struct ContentView: View {
@State private var justified: Justified = .none
@State private var horizontalAlignment: HAlignment = .center
@State private var verticalAlignment: VAlignment = .center
@State private var distibuteItemsEvenly: Bool = false
@State private var distributeItemsEvenly: Bool = false
private let texts = "This is a long text that wraps nicely in flow layout".components(separatedBy: " ").map { string in
AnyView(Text(string))
}
Expand Down Expand Up @@ -79,7 +79,7 @@ struct ContentView: View {
}
Section(header: Text("Extras")) {
picker($justified, style: .radioGroup)
Toggle("Distibute evenly", isOn: $distibuteItemsEvenly.animation())
Toggle("Distibute evenly", isOn: $distributeItemsEvenly.animation())
}
}
.listStyle(.sidebar)
Expand Down Expand Up @@ -137,7 +137,7 @@ struct ContentView: View {
itemSpacing: itemSpacing,
rowSpacing: lineSpacing,
justification: justified.justification,
distibuteItemsEvenly: distibuteItemsEvenly
distributeItemsEvenly: distributeItemsEvenly
)
)
case .vertical:
Expand All @@ -147,7 +147,7 @@ struct ContentView: View {
itemSpacing: itemSpacing,
columnSpacing: lineSpacing,
justification: justified.justification,
distibuteItemsEvenly: distibuteItemsEvenly
distributeItemsEvenly: distributeItemsEvenly
)
)
}
Expand Down
12 changes: 6 additions & 6 deletions Sources/Flow/HFlow.swift
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public struct HFlow<Content: View>: View {
itemSpacing: CGFloat? = nil,
rowSpacing: CGFloat? = nil,
justification: Justification? = nil,
distibuteItemsEvenly: Bool = false,
distributeItemsEvenly: Bool = false,
@ViewBuilder content contentBuilder: () -> Content
) {
content = contentBuilder()
Expand All @@ -49,7 +49,7 @@ public struct HFlow<Content: View>: View {
itemSpacing: itemSpacing,
rowSpacing: rowSpacing,
justification: justification,
distibuteItemsEvenly: distibuteItemsEvenly
distributeItemsEvenly: distributeItemsEvenly
)
}

Expand All @@ -67,15 +67,15 @@ public struct HFlow<Content: View>: View {
alignment: VerticalAlignment = .center,
spacing: CGFloat? = nil,
justification: Justification? = nil,
distibuteItemsEvenly: Bool = false,
distributeItemsEvenly: Bool = false,
@ViewBuilder content contentBuilder: () -> Content
) {
self.init(
alignment: alignment,
itemSpacing: spacing,
rowSpacing: spacing,
justification: justification,
distibuteItemsEvenly: distibuteItemsEvenly,
distributeItemsEvenly: distributeItemsEvenly,
content: contentBuilder
)
}
Expand Down Expand Up @@ -110,14 +110,14 @@ extension HFlow: Layout where Content == EmptyView {
itemSpacing: CGFloat? = nil,
rowSpacing: CGFloat? = nil,
justification: Justification? = nil,
distibuteItemsEvenly: Bool = false
distributeItemsEvenly: Bool = false
) {
self.init(
alignment: alignment,
itemSpacing: itemSpacing,
rowSpacing: rowSpacing,
justification: justification,
distibuteItemsEvenly: distibuteItemsEvenly
distributeItemsEvenly: distributeItemsEvenly
) {
EmptyView()
}
Expand Down
4 changes: 2 additions & 2 deletions Sources/Flow/Internal/HFlowLayout.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ public struct HFlowLayout {
itemSpacing: CGFloat? = nil,
rowSpacing: CGFloat? = nil,
justification: Justification? = nil,
distibuteItemsEvenly: Bool = false
distributeItemsEvenly: Bool = false
) {
layout = .horizontal(
alignment: alignment,
itemSpacing: itemSpacing,
lineSpacing: rowSpacing,
justification: justification,
distibuteItemsEvenly: distibuteItemsEvenly
distributeItemsEvenly: distributeItemsEvenly
)
}
}
Expand Down
12 changes: 6 additions & 6 deletions Sources/Flow/Internal/Layout.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ struct FlowLayout {
var alternatingReversedBreadth: Bool = false
var reversedDepth: Bool = false
var justification: Justification?
var distibuteItemsEvenly: Bool
var distributeItemsEvenly: Bool
let align: (Dimensions) -> CGFloat

private struct ItemWithSpacing<T> {
Expand Down Expand Up @@ -152,7 +152,7 @@ struct FlowLayout {
spacings: [CGFloat],
cache: FlowLayoutCache
) {
guard distibuteItemsEvenly else { return }
guard distributeItemsEvenly else { return }

// Knuth-Plass Line Breaking Algorithm
let proposedBreadth = proposedSize.replacingUnspecifiedDimensions().value(on: axis)
Expand Down Expand Up @@ -284,14 +284,14 @@ extension FlowLayout: Layout {
itemSpacing: CGFloat?,
lineSpacing: CGFloat?,
justification: Justification? = nil,
distibuteItemsEvenly: Bool = false
distributeItemsEvenly: Bool = false
) -> FlowLayout {
.init(
axis: .vertical,
itemSpacing: itemSpacing,
lineSpacing: lineSpacing,
justification: justification,
distibuteItemsEvenly: distibuteItemsEvenly
distributeItemsEvenly: distributeItemsEvenly
) {
$0[alignment]
}
Expand All @@ -302,14 +302,14 @@ extension FlowLayout: Layout {
itemSpacing: CGFloat?,
lineSpacing: CGFloat?,
justification: Justification? = nil,
distibuteItemsEvenly: Bool = false
distributeItemsEvenly: Bool = false
) -> FlowLayout {
.init(
axis: .horizontal,
itemSpacing: itemSpacing,
lineSpacing: lineSpacing,
justification: justification,
distibuteItemsEvenly: distibuteItemsEvenly
distributeItemsEvenly: distributeItemsEvenly
) {
$0[alignment]
}
Expand Down
4 changes: 2 additions & 2 deletions Sources/Flow/Internal/VFlowLayout.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ public struct VFlowLayout {
itemSpacing: CGFloat? = nil,
columnSpacing: CGFloat? = nil,
justification: Justification? = nil,
distibuteItemsEvenly: Bool = false
distributeItemsEvenly: Bool = false
) {
layout = .vertical(
alignment: alignment,
itemSpacing: itemSpacing,
lineSpacing: columnSpacing,
justification: justification,
distibuteItemsEvenly: distibuteItemsEvenly
distributeItemsEvenly: distributeItemsEvenly
)
}
}
Expand Down
16 changes: 8 additions & 8 deletions Sources/Flow/VFlow.swift
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public struct VFlow<Content: View>: View {
itemSpacing: CGFloat? = nil,
columnSpacing: CGFloat? = nil,
justification: Justification? = nil,
distibuteItemsEvenly: Bool = false,
distributeItemsEvenly: Bool = false,
@ViewBuilder content contentBuilder: () -> Content
) {
content = contentBuilder()
Expand All @@ -49,7 +49,7 @@ public struct VFlow<Content: View>: View {
itemSpacing: itemSpacing,
columnSpacing: columnSpacing,
justification: justification,
distibuteItemsEvenly: distibuteItemsEvenly
distributeItemsEvenly: distributeItemsEvenly
)
}

Expand All @@ -67,15 +67,15 @@ public struct VFlow<Content: View>: View {
alignment: HorizontalAlignment = .center,
spacing: CGFloat? = nil,
justification: Justification? = nil,
distibuteItemsEvenly: Bool = false,
distributeItemsEvenly: Bool = false,
@ViewBuilder content contentBuilder: () -> Content
) {
self.init(
alignment: alignment,
itemSpacing: spacing,
columnSpacing: spacing,
justification: justification,
distibuteItemsEvenly: distibuteItemsEvenly,
distributeItemsEvenly: distributeItemsEvenly,
content: contentBuilder
)
}
Expand Down Expand Up @@ -110,14 +110,14 @@ extension VFlow: Layout where Content == EmptyView {
itemSpacing: CGFloat? = nil,
columnSpacing: CGFloat? = nil,
justification: Justification? = nil,
distibuteItemsEvenly: Bool = false
distributeItemsEvenly: Bool = false
) {
self.init(
alignment: alignment,
itemSpacing: itemSpacing,
columnSpacing: columnSpacing,
justification: justification,
distibuteItemsEvenly: distibuteItemsEvenly
distributeItemsEvenly: distributeItemsEvenly
) {
EmptyView()
}
Expand All @@ -136,13 +136,13 @@ extension VFlow: Layout where Content == EmptyView {
alignment: HorizontalAlignment = .center,
spacing: CGFloat? = nil,
justification: Justification? = nil,
distibuteItemsEvenly: Bool = false
distributeItemsEvenly: Bool = false
) {
self.init(
alignment: alignment,
spacing: spacing,
justification: justification,
distibuteItemsEvenly: distibuteItemsEvenly
distributeItemsEvenly: distributeItemsEvenly
) {
EmptyView()
}
Expand Down
2 changes: 1 addition & 1 deletion Tests/FlowTests/FlowTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ final class FlowTests: XCTestCase {

func test_HFlow_distibuted() throws {
// Given
let sut: FlowLayout = .horizontal(alignment: .center, itemSpacing: 1, lineSpacing: 0, distibuteItemsEvenly: true)
let sut: FlowLayout = .horizontal(alignment: .center, itemSpacing: 1, lineSpacing: 0, distributeItemsEvenly: true)

// When
let result = sut.layout(repeated(1×1, times: 13), in: 11×3)
Expand Down

0 comments on commit c5c47e8

Please sign in to comment.