It would be better to reset the scroll position not only when you click on the action button, but also when you click or swipe another view. Anyway great job!
This video came at the best time for me! I was struggling with the native swipe actions because they only work on lists and I have a vertical scrollview in my layout, so putting a list in there creates unexpected behavior and I scrapped it. I have a question about your method though. Is it possible to have swipe actions from both directions at the same time like the native ones?
Great 🎉 What should I do when I want to disable swipe for multiple cells at the same time.? For example when the user swipe another cell, the first one will set back to normal position
You can actually pass the scroll offset to the main view and store it in a model to check whether any other contents are already scrolled. If they're already scrolled, you can disable the interaction for all other views except the dragged view.
@@Kavsoft Thank you so much for replying to my message!! I wanted to make a little bit of a different functionality. When you slide the rectangle to the left instead of displaying some functionality (deleting, saving) I wanted it to swipe to the different page. It's the same functionality as just pushing the button, but I wanted to introduce some interesting functionality for the user.
Update:
Just replace viewID = UUID() with "CONTENTVIEW", since UUID is regenerated whenever the view is removed!
can you be a bit more specific on this? How is content view replacing the declaration of a variable with UUID()? How would you "just replace it"
@@santiagot100 In SwipeAction.swift file, just replace the line `let viewID = UUID()` to `let viewID = "CONTENTVIEW"`
It would be better to reset the scroll position not only when you click on the action button, but also when you click or swipe another view. Anyway great job!
This is exactly what I needed. Was struggling last night on my app, on how to do it.
This video came at the best time for me! I was struggling with the native swipe actions because they only work on lists and I have a vertical scrollview in my layout, so putting a list in there creates unexpected behavior and I scrapped it. I have a question about your method though. Is it possible to have swipe actions from both directions at the same time like the native ones?
I guess u need get the direction from the gesture you scroll offset value
Great 🎉
What should I do when I want to disable swipe for multiple cells at the same time.? For example when the user swipe another cell, the first one will set back to normal position
You can actually pass the scroll offset to the main view and store it in a model to check whether any other contents are already scrolled. If they're already scrolled, you can disable the interaction for all other views except the dragged view.
Great video! ❤
how to make it when the message is swiped to the left it opens a new page with a full message?
I couldn’t understand the question. Can you please explain it in more detail?
@@Kavsoft Thank you so much for replying to my message!! I wanted to make a little bit of a different functionality. When you slide the rectangle to the left instead of displaying some functionality (deleting, saving) I wanted it to swipe to the different page. It's the same functionality as just pushing the button, but I wanted to introduce some interesting functionality for the user.
is this only for ios 17?
Yes!