forgive me if this question has been asked before I did a quick search a couldn't find the answer. I'm creating an app in which a user can receive a friend request and I want the user to be able to swipe to the left to show different options to accept or decline the request
for more clarification this is what I want it to look like
if it helps this is my scroll view
ScrollView(.vertical){
VStack(spacing: 40){
// TODO Add Chat Rooms
ForEach(ChatRooms, content: {room in
//Create an in app link that navigates to messaging screen
NavigationLink(
destination: MessageDetail(messageShowing: $detailShowing),
isActive: $detailShowing,
label: {
//Create a chat room card
Button(action: {
detailShowing = true
}, label: {
ChatRoomView(room: room)
}).buttonStyle(PlainButtonStyle())
}
).buttonStyle(PlainButtonStyle())
})
}.padding(.top, 30)
}
edit: I tried nesting a horizontal scroll view inside my vertical scrollview like the following ScrollView (.horizontal) { VStack(spacing: 40){
// TODO Add Chat Rooms
ForEach(ChatRooms, content: {room in
//Create an in app link that navigates to messaging screen
ScrollView (.horizontal) {
NavigationLink(
destination: MessageDetail(messageShowing: $detailShowing),
isActive: $detailShowing,
label: {
//Create a chat room card
Button(action: {
detailShowing = true
}, label: {
ChatRoomView(room: room)
}).buttonStyle(PlainButtonStyle())
}
).buttonStyle(PlainButtonStyle())
}
})
}.padding(.top, 30)
}
but this is what I end with
try this class :-
https://github.com/EnesKaraosman/SwipeCell
how to use:-