class
UI::SwipeActionRow
- UI::SwipeActionRow
- UI::View
- Reference
- Object
Overview
A list row with optional leading + trailing swipe actions.
On iOS / UIKit: SwiftUI .swipeActions(edge: .trailing) { ... } and
.swipeActions(edge: .leading) { ... } modifiers.
On macOS / AppKit: visible HStack of trailing buttons (HIG — macOS
doesn't have swipe-to-reveal; an explicit row
affordance is the idiomatic equivalent).
On web desktop: visible HStack of trailing buttons (same as macOS).
On web mobile: touch-event handler that translates the row on
touchmove and reveals the trailing-actions panel.
The #content view is the primary row content (typically an HStack
with a label + meta info). Actions are flat lists; the renderer
builds platform-appropriate chrome around them.
Example: row = UI::SwipeActionRow.new(content_view) row.trailing_actions = [ UI::SwipeAction.new("Edit") { open_editor(item) }, UI::SwipeAction.new("Delete", role: :destructive) { delete(item) }, ]
Defined in:
ui/views/swipe_action_row.crConstructors
Instance Method Summary
-
#accept(visitor : PlatformVisitor)
Accept a platform visitor for rendering dispatch.
- #content : View
- #content=(content : View)
- #leading_actions : Array(SwipeAction)
- #leading_actions=(leading_actions : Array(SwipeAction))
-
#mobile_breakpoint_px : Int32
Mobile-web breakpoint: viewports below this width get touch-swipe chrome; viewports at/above this width get visible trailing buttons.
-
#mobile_breakpoint_px=(mobile_breakpoint_px : Int32)
Mobile-web breakpoint: viewports below this width get touch-swipe chrome; viewports at/above this width get visible trailing buttons.
- #trailing_actions : Array(SwipeAction)
- #trailing_actions=(trailing_actions : Array(SwipeAction))
Instance methods inherited from class UI::View
accept(visitor : PlatformVisitor)
accept,
accessibility_label : String | Nil
accessibility_label,
accessibility_label=(accessibility_label : String | Nil)
accessibility_label=,
background : Color | Nil
background,
background=(background : Color | Nil)
background=,
blur_radius : Float64
blur_radius,
blur_radius=(blur_radius : Float64)
blur_radius=,
border_color : Color | Nil
border_color,
border_color=(border_color : Color | Nil)
border_color=,
border_width : Float64
border_width,
border_width=(border_width : Float64)
border_width=,
clip_to_bounds : Bool
clip_to_bounds,
clip_to_bounds=(clip_to_bounds : Bool)
clip_to_bounds=,
container_query(name : String) : self
container_query,
container_query_name : String | Nil
container_query_name,
container_query_name=(container_query_name : String | Nil)
container_query_name=,
corner_radius : Float64
corner_radius,
corner_radius=(corner_radius : Float64)
corner_radius=,
fill_screen! : self
fill_screen!,
fluid_height(min : String | Number, ideal : String | Number, max : String | Number) : selffluid_height : UI::Fluid | Nil fluid_height, fluid_height=(fluid_height : UI::Fluid | Nil) fluid_height=, fluid_width(min : String | Number, ideal : String | Number, max : String | Number) : self
fluid_width : UI::Fluid | Nil fluid_width, fluid_width=(fluid_width : UI::Fluid | Nil) fluid_width=, hidden : Bool hidden, hidden=(hidden : Bool) hidden=, id : String | Nil id, id=(id : String | Nil) id=, maximum_height : Float64 | Nil maximum_height, maximum_height=(maximum_height : Float64 | Nil) maximum_height=, maximum_width : Float64 | Nil maximum_width, maximum_width=(maximum_width : Float64 | Nil) maximum_width=, minimum_height : Float64 | Nil minimum_height, minimum_height=(minimum_height : Float64 | Nil) minimum_height=, minimum_width : Float64 | Nil minimum_width, minimum_width=(minimum_width : Float64 | Nil) minimum_width=, opacity : Float64 opacity, opacity=(opacity : Float64) opacity=, padding : EdgeInsets padding, padding=(padding : EdgeInsets) padding=, root_fill : Bool root_fill, root_fill=(root_fill : Bool) root_fill=, shadow_color : Color | Nil shadow_color, shadow_color=(shadow_color : Color | Nil) shadow_color=, shadow_offset_x : Float64 shadow_offset_x, shadow_offset_x=(shadow_offset_x : Float64) shadow_offset_x=, shadow_offset_y : Float64 shadow_offset_y, shadow_offset_y=(shadow_offset_y : Float64) shadow_offset_y=, shadow_radius : Float64 shadow_radius, shadow_radius=(shadow_radius : Float64) shadow_radius=, swiftkit_state_handle : Pointer(Void) | Nil swiftkit_state_handle, swiftkit_state_handle=(swiftkit_state_handle : Pointer(Void) | Nil) swiftkit_state_handle=, test_id : String | Nil test_id, test_id=(test_id : String | Nil) test_id=
Constructor Detail
Instance Method Detail
Accept a platform visitor for rendering dispatch.
Each concrete view type calls visitor.visit(self).
Mobile-web breakpoint: viewports below this width get touch-swipe chrome; viewports at/above this width get visible trailing buttons. Defaults to 768px (tablet-portrait boundary).
Mobile-web breakpoint: viewports below this width get touch-swipe chrome; viewports at/above this width get visible trailing buttons. Defaults to 768px (tablet-portrait boundary).