SwiftUI 2.0 | Building Adaptive Vertical Grid List with LazyVGrid | Basics & App Examples

preview_player
Показать описание
In this tutorial video, we'll learn about the fundamentals of the LazyVGrid and GridItem, difference between grid item type such as fixed, flexible, and adaptive using the live preview.

Using the fundamentals, we’re going to build an iOS app that uses a single Vertical Grid to build a list that supports 3 different layouts. We should be able to switch the layout in the runtime using a segmented picker.
#swiftui2 #iosdev #lazyvgrid #swiftui

GitHub Project Repository:

Timeline:
00:00 Introduction
00:52 LazyVGrid & GridItem Documentation
03:10 Setting up LazyVGrid
04:20 Example - Fixed Size Grid Item
05:32 Example - Flexible Size Grid Item
07:10 Example - Adaptive Size Grid Item
08:43 App Demo
09:42 Building The iOS App
16:50 Closing

WWDC 2020 Video Session - Stack, Grid, Outline

Social Media:

Thank you for watching!
Рекомендации по теме
Комментарии
Автор

Thanks for sharing this code! I'm looking for implementing this on iOS and macOS and it's an interesting quest every time working in SwiftUI since it's not widely adopted. Thank you again!

midwestflying
Автор

hi, do you know how to do a staggered grid or masonry with swift ui, will you be able to show us...

GameCrawl
Автор

Hi, thank you for this tutorial, very nice video!!

The only question I have about the image grid is that I cannot find a way to "square" the images correctly, either they are in the fit mode, which has lots of white spaces for portraits and landscapes, or the images will be "shrunk" into the square size. Can you please help me with that? Appreciate your help!

jiuzhenpan