Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions Sources/SwipeActions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,8 @@ public struct SwipeOptions {
/// The width for each action.
var actionWidth = Double(100)

var actionMaxHeight: Double = .infinity

/// Spacing between actions and the label view.
var spacing = Double(8)

Expand Down Expand Up @@ -675,7 +677,7 @@ struct SwipeActionsLayout: _VariadicView_UnaryViewRoot {

Color.clear.overlay(
child
.frame(maxHeight: .infinity)
.frame(maxHeight: options.actionMaxHeight)
.frame(width: width)
.opacity(shown ? 1 : 0)
.mask(
Expand All @@ -686,7 +688,7 @@ struct SwipeActionsLayout: _VariadicView_UnaryViewRoot {
.zIndex(Double(zIndex))
} else {
child
.frame(maxHeight: .infinity)
.frame(maxHeight: options.actionMaxHeight)
.frame(width: width)
.opacity(shown ? 1 : 0)
.mask(
Expand Down Expand Up @@ -1170,6 +1172,12 @@ public extension SwipeView {
return view
}

func swipeActionMaxWidth(_ value: Double) -> SwipeView {
var view = self
view.options.actionMaxHeight = value
return view
}

/// Spacing between actions and the label view.
func swipeSpacing(_ value: Double) -> SwipeView {
var view = self
Expand Down