Questions tagged [swiftui-swipeactions]
18 questions
6
votes
1 answer
SwiftUI use editMode's onDelete modifier alongside with custom Swipe Actions on iOS 15
Initial description
I currently have a dynamic list and I'm using the SwiftUI built-in editMode feature and the built-in EditButton() in order to let the user to delete items from the list.
For the deletion part, I am using the onDelete modifier…

AdamSwift
- 75
- 6
5
votes
0 answers
Programmatically show swipe actions in SwiftUI
Given:
SectionView as a row representation in a List
Swipe actions associated with this view
Tappable Image as a part of the same view
Required:
Display swipe actions on Image tap, not only using a swipe gesture.
Will be thankful for any clues…

Anton Breza
- 71
- 3
4
votes
0 answers
Swipe action image color SwiftUI
I'm trying to modify the color of the Image in the swipe action of a list in SwiftUI.
I have tried a few things:
Setting the image with rendering template and after that applied the foregroundColor modifier
Setting foregroundColor modifier directly…

Alessandro Pace
- 206
- 4
- 8
3
votes
0 answers
How do I change the text color of a SwiftUI swipeAction button?
I have a swipeAction in my SwiftUI list and I can't seem to change the color of the text. It is always white.
.swipeActions(edge: HorizontalEdge.leading, allowsFullSwipe: false) {
Button {
} label: {
Text("July 3rd")
…

alionthego
- 8,508
- 9
- 52
- 125
2
votes
0 answers
SwipeAction does not work in TabView SwiftUI
I have List in the TabView. List has text/button with delete and update swipe action. The swipe action does not work in the tabview but it is work fine without tab view. Below is my code.
TabView {
List {
ForEach(0..<5, id: \.self)…

Muhammad Farooq
- 263
- 3
- 10
2
votes
1 answer
With SwiftUI 3.0 .swipeActions in a ForEach how do you have an action go to another view while passing that view the input argument of the ForEach?
I am tying to add a .swipeAction to a ForEach list in which I want to pass the element in the list that was selected by the user to another invoked View. In other words when the user swipes on an item in the list, I want the user to be taken to a…

JustMe
- 319
- 3
- 11
1
vote
1 answer
SwiftUI from .ondelete to .swipeAction
I have a ForEach with a dynamic array with an .ondelete. The code works as expected. Now I want to switch to .swipeAction because I want to implement no fullSwipe.
.onDelete works with IndexSet, how can I implement this in a .swipeAction?
How get I…

Michael
- 616
- 5
- 20
0
votes
0 answers
How can I implement custom .swipeActions() in my Scrollview-LazyVStack?
I've tried all the available libraries out there but there are bugs which prevent me from scaling with these libraries.
SwipeActions (Triggers are not reliable, I'm able to reliably reproduce the unintended results - have filed an issue on their…

ayelvs
- 425
- 1
- 5
- 9
0
votes
0 answers
SwiftUI: On tap gesture in List interferes with swipe to delete – How to prevent this?
I am having an issue with multiple gestures affecting a single list. I want to have a modifier on the list itself that will create a new row if a user taps anywhere outside of a row. However, it triggers in place of the swipe-to-delete button if…

Sam
- 13
- 4
0
votes
0 answers
Inconsistently able to trigger a SwipeAction when there is a DragGesture on a parent view
The problem I'm facing is with competing gestures.
There's a DragGesture on the parent view to allow the user to return to the previous screen.
Then theres a list, which is a child view, that has a swipeAction for its own child views.
These two…

Santana_says
- 1
- 1
0
votes
0 answers
Programmatically activating swipeActions in a List (Similar to alarms in Clock and lists in Contacts apps)
I was looking to replicate the functionality contained in the native iOS Clock and Contacts apps for list items. After pressing "Edit" at the top right, red "minus" circles appear on the left side of each list item. If you press the minus sign, it…

Hiram Stout
- 1
- 1
0
votes
1 answer
how to avoid slow lists with swipeAction in swift?
I have a list, and I want to use swipeAction to either set or unset a property on the list items. My problem is that the function to decide if the property is set or unset is slow, and it runs not just when the user swipes (as I thought) but for…

themadp
- 23
- 2
0
votes
1 answer
Set image color in SwipeAction
I'm trying to customise color of icon in swipeAction of SwiftUI. Outside foregroundColor() it works, inside, - not.
Button {
print("Hello")
} label: {
Label(
title: {},
…

Konstantin.Efimenko
- 1,242
- 1
- 14
- 38
0
votes
0 answers
Why are my SwipeActions overflowing the listview SwiftUI
Why is my SwiftUI Swipe Action behaving like this?
I don't now how to add a GIF in stack overflow so here is a imagur link https://i.stack.imgur.com/VCKEE.jpg.
If you don't want to click on external links here is a image from the GIF:
My…

Boothosh81
- 387
- 1
- 5
- 24
0
votes
1 answer
SwiftUI swipeActions reload results in leading blank space and broken swipe
I am trying to use the swipeActions SwiftUI modifier setup as displayed in the code below but the swipe action gets disabled as seen on this gif:
struct ContentView: View {
@ObservedObject var viewModel: ViewModel
var body: some View {
if…

Zsolt
- 3,648
- 3
- 32
- 47