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!
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!
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?
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
@@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!! 👍
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
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.
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?
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
@@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.
Fantastic! Can we have vision pro app tutorial video soon??
👍👍👍
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!
My Favorite Swift teacher soon that saw the notification I can’t resist
need full complex swiftui app with mvvm
Incredible !! 😮
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!
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?
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
@@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!! 👍
God bless you And your family ❤❤❤
YOoooo
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
Great video for some new features in ScrollView, thanks!
Now a bit general question considering pagination: List vs. ScrollView - which one is better?
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
Great tutor! Can you talk about singleton?
Great video, thank you. After screen rotation to landscape and back paging didn't work 🤬
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.
as usual top-notch information!
Great content as always Nick!
i know this for IOS 17 Fans, but is there anyone alive here knows how todo the same in IOS 16 !!
I covered that earlier in this course: ruclips.net/video/ZkOvD3okAJo/видео.htmlsi=IDwQS_d7HFyWm3T7
Looks great. 👍
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?
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
@@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.