Paging ScrollView in SwiftUI for iOS 17 | Continued Learning #34

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

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

  • @911gogogo
    @911gogogo 6 месяцев назад +5

    Fantastic! Can we have vision pro app tutorial video soon??

  • @jlcoder
    @jlcoder 2 месяца назад

    👍👍👍

  • @RobertHolzapfel
    @RobertHolzapfel Месяц назад

    Based on that video I tried to implement a custom WheelPicker, trying to add an 3d rotation effect when the views leave the center and a a decreasing opacity ,,, at the end I gave up, it started promising, but finally I could not realize it properly .... So, dear Nick, if you ever, ever have time in the future, that might be a nice topic, because the standard Picker (style wheel) on SwiftUI is not really meeting high class UI needs. Though, thanks a lot for your valuable content!

  • @FabricioMTL
    @FabricioMTL 6 месяцев назад +5

    My Favorite Swift teacher soon that saw the notification I can’t resist

  • @UmarFarooqParacha
    @UmarFarooqParacha Месяц назад

    need full complex swiftui app with mvvm

  • @rayhaanalykhan
    @rayhaanalykhan 6 месяцев назад +3

    Incredible !! 😮

  • @BookwrmApp
    @BookwrmApp 6 месяцев назад +1

    THANK YOU SO MUCH. I have been plagued by ignorance the past couple of months. I had no idea why when I scrolled in all of my ScrollViews there appeared to be a slight offset that got worse and worse with every scroll. It was driving me crazy.
    No spacing modifiers outside of the content in the ScrollView just solved my issues!

  • @tonyscamurra8409
    @tonyscamurra8409 2 месяца назад

    This is great!! I am curios about something... you talk about a feed... how would one go about dynamically loading more items? In your example you have a fixed set of items set to 20. How would I detect the scroll or know when I get to some page so I can load more?

    • @SwiftfulThinking
      @SwiftfulThinking  2 месяца назад

      You can put an “onAppear” on the last cell (or close to the end) that triggers a function to append more to the array. Similar example here: ruclips.net/video/4iTb8ruXsjg/видео.htmlsi=qtEHGQKwY6VyqbVk

    • @tonyscamurra8409
      @tonyscamurra8409 2 месяца назад

      @@SwiftfulThinking I will take a look. For now I solved it like this:
      1) I do an initial load in onAppear.
      2) I track the scroll position with a GeometryReader. I wrap each item in a GeometryReader which allows me to read its position on the screen. Then I use a custom PreferenceKey to pass the position up the hierarchy.
      3)Then I use onPreferenceChange modifier to listen for changes to the key. When a change is detected I update the visible index
      4) I then calculate the visible index
      5) Finally, if the visible index is equal to my list count - 5 (can be any number), I load more items
      I will look at the link you sent, maybe what is in there is simpler, although this was not too much code and seems to work well.
      Thanks for the quick reply!! BTW, I love your videos, I have been watching on and off for a long time!! 👍

  • @shamnadpk-ft8ut
    @shamnadpk-ft8ut 6 месяцев назад +1

    God bless you And your family ❤❤❤

  • @offthedeepend762
    @offthedeepend762 22 дня назад

    YOoooo

  • @MustafaGhazi-fo9iu
    @MustafaGhazi-fo9iu 5 месяцев назад

    Thank u so much it was really helpful ❤️❤️ i just wanted to ask if i have 2 HStacks and i want different scroll behavior for each one how i’d do that

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

    Great video for some new features in ScrollView, thanks!
    Now a bit general question considering pagination: List vs. ScrollView - which one is better?

    • @SwiftfulThinking
      @SwiftfulThinking  5 месяцев назад +1

      Generally list is better, but it’s less customizable (for example there is no scroll to cell or pagination). Start with List and fallback to ScrollView, which happens with custom UI more often then not

  • @frankzhang3872
    @frankzhang3872 6 месяцев назад

    Great tutor! Can you talk about singleton?

  • @barche75
    @barche75 2 месяца назад

    Great video, thank you. After screen rotation to landscape and back paging didn't work 🤬

    • @RobertHolzapfel
      @RobertHolzapfel Месяц назад

      You have to 'listen' to the device rotation event and adapt the viewModifiers accordingly, e.g. from " .containerRelativeFrame(.vertical)" to .horzontal, padding the same, and so on.

  • @NickGo
    @NickGo 6 месяцев назад

    as usual top-notch information!

  • @federicoramos
    @federicoramos 6 месяцев назад

    Great content as always Nick!

  • @emadhany1
    @emadhany1 6 месяцев назад

    i know this for IOS 17 Fans, but is there anyone alive here knows how todo the same in IOS 16 !!

    • @SwiftfulThinking
      @SwiftfulThinking  6 месяцев назад

      I covered that earlier in this course: ruclips.net/video/ZkOvD3okAJo/видео.htmlsi=IDwQS_d7HFyWm3T7

  • @RobertSantini
    @RobertSantini 6 месяцев назад

    Looks great. 👍

  • @slmille4
    @slmille4 6 месяцев назад

    What do you mean by "the vast majority of apps are probably never going to use Swift data and if they do it's not going to be for a very long time"? Do you mean they'll need to switch over to Core Data?

    • @SwiftfulThinking
      @SwiftfulThinking  6 месяцев назад

      SwiftData is made for SwiftUI apps that are iOS17+ only. That’s a very small percentage of apps. And there’s little to no benefit to switch from CoreData to Swiftdata

    • @mario_luis_dev
      @mario_luis_dev 4 месяца назад

      @@SwiftfulThinkingI do agree with you on this paging ScrollView being such a big deal, but I don’t quite agree in that there’s little to no benefit in going from CoreData to SwiftData…I think the upgrade is massive, at least in terms of ease of use of the API.