From d09a5939a00f0e152d82a270b0f5044beba418f7 Mon Sep 17 00:00:00 2001 From: Eric Andrews Date: Sat, 30 Sep 2023 12:28:49 -0400 Subject: [PATCH] documentation --- Mlem/Extensions/Swipey Actions.swift | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Mlem/Extensions/Swipey Actions.swift b/Mlem/Extensions/Swipey Actions.swift index fc8b72af5..94c97a3d5 100644 --- a/Mlem/Extensions/Swipey Actions.swift +++ b/Mlem/Extensions/Swipey Actions.swift @@ -347,6 +347,12 @@ struct SwipeyView: ViewModifier { // swiftlint:enable function_body_length extension View { + /// Adds swipey actions to a view. + /// + /// NOTE: if the view you are attaching this to also has a context menu, add the context menu view modifier AFTER the swipey actions modifier! This will prevent the swipey action from triggering and appearing bugged on an aborted context menu pop if the context menu animation initiates. + /// - Parameters: + /// - leading: leading edge swipey actions, ordered by ascending swipe distance from leading edge + /// - trailing: trailing edge swipey actions, ordered by ascending swipe distance from leading edge @ViewBuilder func addSwipeyActions(leading: [SwipeAction?], trailing: [SwipeAction?]) -> some View { modifier(