Swipe Actions For ScrollView - No Gestures! - iOS 17 Scroll APIs - Xcode 15

Поделиться
HTML-код
  • Опубликовано: 1 ноя 2024

Комментарии • 15

  • @Kavsoft
    @Kavsoft  10 месяцев назад +2

    Update:
    Just replace viewID = UUID() with "CONTENTVIEW", since UUID is regenerated whenever the view is removed!

    • @santiagot100
      @santiagot100 5 месяцев назад

      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"

    • @Kavsoft
      @Kavsoft  5 месяцев назад

      @@santiagot100 In SwipeAction.swift file, just replace the line `let viewID = UUID()` to `let viewID = "CONTENTVIEW"`

  • @AndreiZhukouski
    @AndreiZhukouski 11 месяцев назад +4

    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!

  • @coldwolf5050
    @coldwolf5050 11 месяцев назад

    This is exactly what I needed. Was struggling last night on my app, on how to do it.

  • @alexsavides1903
    @alexsavides1903 11 месяцев назад +3

    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?

    • @yq_dev
      @yq_dev 8 месяцев назад

      I guess u need get the direction from the gesture you scroll offset value

  • @mkhasson97
    @mkhasson97 11 месяцев назад +1

    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

    • @Kavsoft
      @Kavsoft  11 месяцев назад +1

      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.

  • @accountforyoutube2280
    @accountforyoutube2280 11 месяцев назад

    Great video! ❤
    how to make it when the message is swiped to the left it opens a new page with a full message?

    • @Kavsoft
      @Kavsoft  11 месяцев назад

      I couldn’t understand the question. Can you please explain it in more detail?

    • @accountforyoutube2280
      @accountforyoutube2280 11 месяцев назад

      @@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.

  • @wahhmann123
    @wahhmann123 7 месяцев назад

    is this only for ios 17?