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!
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!
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.
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
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
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!! 👍
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.
My Favorite Swift teacher soon that saw the notification I can’t resist
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!
Fantastic! Can we have vision pro app tutorial video soon??
not sure how i missed this great video?
Incredible !! 😮
Such a good tutorial. Thanks a lot :)
as usual top-notch information!
are you going to make tutorials about swiftdata soon?
Thank you Nick! you saved my ass again... thanks a lot
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!
God bless you And your family ❤❤❤
Great content as always Nick!
How do we disable bounce or scroll up if you have empty list but can pull down to refresh?
这篇真的棒极了。不过很可惜这 API 只能在 iOS 17 上才可使用。
Great tutor! Can you talk about singleton?
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.
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
Looks great. 👍
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
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
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!! 👍
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.
Refreshable
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.
👍👍👍
YOoooo
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