LazyVGrid, LazyHGrid, and GridItems in SwiftUI | Bootcamp #16

  Рет қаралды 43,488

Swiftful Thinking

Swiftful Thinking

Күн бұрын

LazyGrids are a relatively new feature in SwiftUI that allow us to easily layout content on the screen in a grid formation. In this video we will dive-in to learn how to implement and customize them to make them dynamic and adaptable. By the end of this video, you will know how to use LazyVGrid and LazyHGrid with multiple different formatting techniques.
Next video: • How to use and ignore ...
Last video: • Implementing a ScrollV...
🤙 WELCOME BACK 🤙
WEBSITE: www.swiftful-thinking.com
DISCORD: / discord
GITHUB: github.com/SwiftfulThinking/
SAY THANKS: www.buymeacoffee.com/nicksarno

Пікірлер: 75
@AZMerf
@AZMerf 3 жыл бұрын
Your “real world” examples are super helpful.
@SwiftfulThinking
@SwiftfulThinking 3 жыл бұрын
Thanks for watching Merrill! Happy to help.
@m__link6499
@m__link6499 3 жыл бұрын
Damn!!!! I'm becoming addicted to your vids....😱😱😱
@SwiftfulThinking
@SwiftfulThinking 3 жыл бұрын
Thanks 🥳🥳🥳
@olepetersen4460
@olepetersen4460 3 жыл бұрын
Messing around with the modifiers in fx the Section header is so much easier in the list form, you show. Thanks again!
@romanpurishy
@romanpurishy 2 жыл бұрын
The most useful lessons I saw.
@jimmyhuang1114
@jimmyhuang1114 2 жыл бұрын
Great tutorial. Thanks for your sharing.
@shadowseekerme
@shadowseekerme 2 жыл бұрын
Your tutorials are indeed helpful, starting from the smallest to a group of task and also helps understand them easily.
@SwiftfulThinking
@SwiftfulThinking 2 жыл бұрын
Thanks Alok!!
@sebastianciuca7463
@sebastianciuca7463 7 ай бұрын
Well explained, enthusiastic, practical examples, AND handsome? Easy to have a crush on this guy
@andrejkling3886
@andrejkling3886 3 жыл бұрын
Excellent lesson Nick.... thank you
@SwiftfulThinking
@SwiftfulThinking 3 жыл бұрын
Thanks as always Andrej!
@user-yd9xy3rb4x
@user-yd9xy3rb4x 3 жыл бұрын
Damnit, this one is extremely helpful.
@Watashi10
@Watashi10 Жыл бұрын
Amazing content! Thanks a lot :)
@nevemra5
@nevemra5 Жыл бұрын
Great guy. Really. You are perfect. Thank you!
@easontang8932
@easontang8932 3 жыл бұрын
rewatching these for basics
@SwiftfulThinking
@SwiftfulThinking 3 жыл бұрын
Love that :)
@craigswanson410
@craigswanson410 2 жыл бұрын
This was a great video. I will definitely be watching more of yours! Also, an advantage of adaptive size is that if I have an app that runs on iPhone, iPad, and Mac, I can just make one GridItem with a minimum size and it will make the appropriate number of columns based on device size.
@SwiftfulThinking
@SwiftfulThinking 2 жыл бұрын
Hey Craig! Yea, these are so useful honestly. Easy to use and memory efficient :)
@Said_Abror
@Said_Abror 2 жыл бұрын
Super-useful Lessons from Super KZfaqr ) Thanks
@taasinbinhossainalvi9173
@taasinbinhossainalvi9173 Жыл бұрын
Thanks Nick! :D
@abdullahkardas8887
@abdullahkardas8887 2 жыл бұрын
Perfect video
@amith2947
@amith2947 3 жыл бұрын
Bro, I actually laughed at that joke you made in the intro. good one 🤣👍
@SwiftfulThinking
@SwiftfulThinking 2 жыл бұрын
Haha me and you only 😅😂
@user-ev3dl9zt8s
@user-ev3dl9zt8s 3 жыл бұрын
Thank you!!!
@ZhengCheng
@ZhengCheng 3 жыл бұрын
very nice
@DaraJu-cw9il
@DaraJu-cw9il Жыл бұрын
awesome video
@magedmohmed4403
@magedmohmed4403 Жыл бұрын
lazyVGrid & LazyHGrid , Thank you again for a very helpful explanation 🤎🤎
@praveenkumar-yj5mm
@praveenkumar-yj5mm Жыл бұрын
Awesome!
@amandadias2078
@amandadias2078 11 ай бұрын
thank youuuuuuuuuu!! i love your videossssssss
@SwiftfulThinking
@SwiftfulThinking 11 ай бұрын
Thanks Amanda! 😁🤙
@gregohb
@gregohb 3 жыл бұрын
great example
@SwiftfulThinking
@SwiftfulThinking 3 жыл бұрын
Thanks G!
@user-sk9qo7tx3o
@user-sk9qo7tx3o 4 ай бұрын
Hello Thank you for course
@sakshipatil9537
@sakshipatil9537 2 жыл бұрын
Hey Nick, really nice video. I was just wondering if I can use .adaptive to create tags . eg: eg. if tags are long, we fit 2 in one row, but if they are short, maybe 3 or 4 fits in one row.?
@knowledgeispower4953
@knowledgeispower4953 6 ай бұрын
super bro..😉
@SwiftfulThinking
@SwiftfulThinking 6 ай бұрын
You’re going beast mode 🚀 I see u 🤙
@abhaykumar3333
@abhaykumar3333 Жыл бұрын
Awesome SwiftUI series its really helpful. can you prove the link to download the entire project.
@Nunny25
@Nunny25 3 жыл бұрын
Thanks..
@mikedougmilk24
@mikedougmilk24 2 жыл бұрын
Thanks for this video. @5:07 when I type in 'GridItem' and then open the parenthesis my options are not the same as yours, it gives me the option of "self, super, etc" and then a giant list of other options. I wonder if there is a setting that will show me the appropriate completions, like yours.
@m__link6499
@m__link6499 3 жыл бұрын
Dude the adaptive property Will perfectly suit when we could design a website one day with swiftWeb, especially for the responsive matter...
@SwiftfulThinking
@SwiftfulThinking 3 жыл бұрын
That would be cool! You're always thinking haha
@mansamusa8653
@mansamusa8653 11 ай бұрын
@rbasamac
@rbasamac 2 жыл бұрын
Is there any way to set .shadow (or anything else) to a Section header only when it gets pinned, but otherwise keep it as it is (without shadow)?
@haidersalih287
@haidersalih287 3 жыл бұрын
thank u
@SwiftfulThinking
@SwiftfulThinking 3 жыл бұрын
Thanks for watching Haider!
@dadrewco100
@dadrewco100 3 жыл бұрын
Hi I am watching your videos. They are very good . Will you show later how to connect grids to images and questions to make questions apps?
@SwiftfulThinking
@SwiftfulThinking 3 жыл бұрын
Of course! If you just change the Rectangle() for an Image or Text, it will work!
@sreekanthzyou
@sreekanthzyou 2 жыл бұрын
Is it replacement of collectionview of UIKit? we can build a Calendar with the Gridview.
@SwiftfulThinking
@SwiftfulThinking 2 жыл бұрын
There is no CollectionView or TableView in SwiftUI, so yes, not we can simply use LazyGrids or LazyStacks and put them in ScrollViews. It's much easier because we don't have to deal with the delegate methods anymore!
@glorytoukraine6956
@glorytoukraine6956 2 жыл бұрын
Thanks for this video! What about handling tap gesture? Eg. if we need to change tile color, highlight some element.
@AlexandrTej
@AlexandrTej Жыл бұрын
Hello Nick! You are best teacher :) Say please - how I can create HGrid and VGrid for iOS 13? I have old MacBook 2015 with MacOS Catalina and iPhone 7 with iOS 13.6. Thank you for answer! :)
@SwiftfulThinking
@SwiftfulThinking Жыл бұрын
You would need to create you’re own combination of VStacks and Hstacks
@AlexandrTej
@AlexandrTej Жыл бұрын
@@SwiftfulThinking thanks. Second question:) How I can create pinned header on top (pinned views)?
@SwiftfulThinking
@SwiftfulThinking Жыл бұрын
@@AlexandrTej I wouldn’t do that for iOS 13.. I’d write some code that uses the LazyVGrid on iOS 14+ and has a fallback for iOS 13 without it
@AlexandrTej
@AlexandrTej Жыл бұрын
@@SwiftfulThinking but I have Xcode 11.3 and I can not write this code for iOS 14 :(
@SwiftfulThinking
@SwiftfulThinking Жыл бұрын
@@AlexandrTej can you upgrade above Catalina? iOS 14 made major updates to SwiftUI and you’re going to spend a crazy amount of extra time debugging and dealing with issues like this if you’re learning on iOS 13
@thedrenkemp124
@thedrenkemp124 3 жыл бұрын
HI! New sub. I have a question how do you put different images in grids, with words written on them?
@SwiftfulThinking
@SwiftfulThinking 3 жыл бұрын
Hi Thedren! You could do something similar to what I did in the video, but instead of a Rectangle() you can use your own custom view. It sounds like you could use an Image() and use an .overlay() with a Text() inside. I have seperate videos in the playlist that cover these topics as well!
@thedrenkemp124
@thedrenkemp124 3 жыл бұрын
@@SwiftfulThinking thank you.
@JPkatukenda
@JPkatukenda 2 жыл бұрын
wow
@randlyce
@randlyce 2 жыл бұрын
damnnnnnn
@alextoma402
@alextoma402 10 ай бұрын
I've yet to find a video where someone can actually explain responsive design with swiftUI - for example: How do we get all items in a grid to have a aspect ratio of 1:1 and also have the grid take up as much width as necessary? With HTML and CSS this is a very simple thing to do, but in SwiftUI it seems like I have jump through a million hoops to figure it out... Why is there no good content for truly responsive design????
@Itkhld
@Itkhld 2 ай бұрын
Hello nick, I am using xcode 15, when i use ForEach i got the following error. argument passed to call that takes no arguments. Can you please help me how to fix the error?
@SwiftfulThinking
@SwiftfulThinking 2 ай бұрын
You’re typing something wrong
@Itkhld
@Itkhld 2 ай бұрын
@@SwiftfulThinking thank you for replying. Everything is written correctly, even i copied your code from github and still i got the same error.
@SwiftfulThinking
@SwiftfulThinking 2 ай бұрын
@@Itkhldthe code on GitHub compiles correctly. You can join our Discord if you want help with your code 👍
@dugrut1325
@dugrut1325 2 жыл бұрын
I wish real world had actual data to see, I'm presuming you replace Rectangle with Text or Image???
@SwiftfulThinking
@SwiftfulThinking 2 жыл бұрын
Replace it with any View. Could be a Text but also could be anything else! You’ll see after a couple more videos haha. I see you’re cruising through 😂
@dugrut1325
@dugrut1325 Жыл бұрын
@@SwiftfulThinking Wow 5 months ago seems like a life time. I finally understood the concept of dropping in any control.
@fruity_cereal_IDV
@fruity_cereal_IDV Жыл бұрын
10:40
@emdutt4012
@emdutt4012 2 жыл бұрын
Brother where is LazyHgrid.?
@heatjnr
@heatjnr Ай бұрын
Lol
@sharifboymuminov9734
@sharifboymuminov9734 8 ай бұрын
Hello World
How to use and ignore the Safe Area in SwiftUI | Bootcamp #17
17:24
Swiftful Thinking
Рет қаралды 26 М.
Llegó al techo 😱
00:37
Juan De Dios Pantoja
Рет қаралды 60 МЛН
I'm Excited To see If Kelly Can Meet This Challenge!
00:16
Mini Katana
Рет қаралды 30 МЛН
Mom's Unique Approach to Teaching Kids Hygiene #shorts
00:16
Fabiosa Stories
Рет қаралды 38 МЛН
Super Power Scroll Views - SwiftUI - iOS 17
9:14
Sean Allen
Рет қаралды 25 М.
How to Create Branches and Merge Changes | Git & Source Control #6
29:36
Swiftful Thinking
Рет қаралды 1,2 М.
How to use NavigationStack in SwiftUI | Bootcamp #62
23:59
Swiftful Thinking
Рет қаралды 32 М.
SwiftUI Tutorial: iOS 16 Grids
5:33
Design to SwiftUI
Рет қаралды 3,3 М.
Llegó al techo 😱
00:37
Juan De Dios Pantoja
Рет қаралды 60 МЛН