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

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

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

  • @FabricioMTL
    @FabricioMTL 11 месяцев назад +7

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

  • @BookwrmApp
    @BookwrmApp 10 месяцев назад +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!

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

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

  • @DugRutBV
    @DugRutBV Месяц назад +1

    not sure how i missed this great video?

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

    Incredible !! 😮

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

    Such a good tutorial. Thanks a lot :)

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

    as usual top-notch information!

  • @MarkusBuchanan-p6e
    @MarkusBuchanan-p6e 18 дней назад

    are you going to make tutorials about swiftdata soon?

  • @gagnassss
    @gagnassss 3 месяца назад

    Thank you Nick! you saved my ass again... thanks a lot

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

    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!

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

    God bless you And your family ❤❤❤

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

    Great content as always Nick!

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

    How do we disable bounce or scroll up if you have empty list but can pull down to refresh?

  • @shangmaumau
    @shangmaumau Месяц назад +1

    这篇真的棒极了。不过很可惜这 API 只能在 iOS 17 上才可使用。

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

    Great tutor! Can you talk about singleton?

  • @rishabhbhatia1847
    @rishabhbhatia1847 12 дней назад

    Hi, after learning all this I need to make a slightly intermmediate level app but using latest frameworks by apple like siwft data and latest UI components. Do you have any playlist where we build a decent app using iOS 17 or 18 and latest Xcode and swift features? Your content is great but at present it is mixed of old and new features released by apple.

    • @SwiftfulThinking
      @SwiftfulThinking  12 дней назад

      The crypto app on my channel is still relevant for learning. Otherwise the SwiftUI Advanced Architecture course has all of the new features.
      The watch order is posted here and there is a lot of playlists using the new features available on YT: www.swiftful-thinking.com/store

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

    Looks great. 👍

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

    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  9 месяцев назад +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

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

    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

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

    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  6 месяцев назад

      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 6 месяцев назад

      @@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!! 👍

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

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

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

      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.

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

    Refreshable

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

    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  11 месяцев назад

      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 8 месяцев назад

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

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

    👍👍👍

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

    YOoooo

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

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

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

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