Skip to content

Commit

Permalink
Change the argument label of snappable
Browse files Browse the repository at this point in the history
  • Loading branch information
hugehoge committed Jan 7, 2022
1 parent 30bf47a commit 2e6105f
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ struct CarouselView: View {
}
}
}
.snappable(snapAlignment, mode: snapMode)
.snappable(alignment: snapAlignment, mode: snapMode)
}

private func color(_ index: Int) -> Color {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ struct MultiWidthCarouselView: View {
}
}
}
.snappable(snapAlignment, mode: snapMode)
.snappable(alignment: snapAlignment, mode: snapMode)
}

private func color(_ index: Int) -> Color {
Expand Down
5 changes: 4 additions & 1 deletion Example/VerticalExample/VerticalExample/ContentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ struct ContentView: View {
}
}
}
.snappable(.bottom, mode: .afterScrolling(decelerationRate: .normal))
.snappable(
alignment: .bottom,
mode: .afterScrolling(decelerationRate: .normal)
)
}

private func color(_ index: Int) -> Color {
Expand Down
2 changes: 1 addition & 1 deletion Sources/Public/ScrollView+SnappableModifier.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ public extension ScrollView {
/// - mode: The mode by when ScrollView snaps the items.
/// - Returns: A ScrollView, with the snapping behavior set.
func snappable(
_ alignment: SnapAlignment = .center,
alignment: SnapAlignment = .center,
mode: SnapMode = .immediately
) -> some View {
self.modifier(SnappableModifier(alignment: alignment, mode: mode))
Expand Down

0 comments on commit 2e6105f

Please sign in to comment.