class
UI::SwipeAction
- UI::SwipeAction
- Reference
- Object
Overview
A single swipe action attached to a SwipeActionRow.
On iOS / mobile-web: revealed by swiping the row horizontally. On macOS / desktop-web: rendered inline as a visible trailing button.
#role accepts :default, :destructive, :cancel. The renderer maps
destructive to the platform-native danger tint (red on iOS / macOS /
web via --ap-color-danger-text).
#icon is the SF Symbol name on iOS / macOS, ignored elsewhere.
#on_tap is the callback fired when the user activates the action.
On iOS / macOS it's registered through the existing Phase 3
CallbackRegistry so the Crystal Proc isn't GC'd while native code
holds a function pointer to it.
Defined in:
ui/views/swipe_action_row.crConstructors
Instance Method Summary
- #icon : String | Nil
- #icon=(icon : String | Nil)
- #label : String
- #label=(label : String)
- #on_tap : Proc(Nil) | Nil
- #on_tap=(on_tap : Proc(Nil) | Nil)
-
#on_tap_route : String | Nil
Optional route id the web renderer wires to a client-side UIRouteHost.push() invocation.
-
#on_tap_route=(on_tap_route : String | Nil)
Optional route id the web renderer wires to a client-side UIRouteHost.push() invocation.
- #role : Symbol
- #role=(role : Symbol)
Constructor Detail
Instance Method Detail
Optional route id the web renderer wires to a client-side UIRouteHost.push() invocation. The static-site web target cannot invoke Crystal Procs client-side, so demos that need runtime swipe-button interactivity supply this string.
Optional route id the web renderer wires to a client-side UIRouteHost.push() invocation. The static-site web target cannot invoke Crystal Procs client-side, so demos that need runtime swipe-button interactivity supply this string.