Skip to content

Instantly share code, notes, and snippets.

View gurjitdhiman's full-sized avatar
:octocat:

Gurjit Singh gurjitdhiman

:octocat:
View GitHub Profile
@universeye
universeye / LazyGridDemo.swift
Created July 18, 2023 09:18
LazyVGrid & LazyHGrid
import SwiftUI
struct LazyVGridDemo: View {
private var symbols = ["keyboard", "hifispeaker.fill", "printer.fill", "tv.fill", "desktopcomputer", "headphones", "tv.music.note", "mic", "plus.bubble", "video"]
private var colors: [Color] = [.yellow, .purple, .green]
private var gridItemLayout1 = [GridItem(.flexible()), GridItem(.flexible()), GridItem(.flexible())]
private var sixColumnGrid: [GridItem] = Array(repeating: .init(.flexible()), count: 6)
private var gridItemLayout2 = [GridItem(.adaptive(minimum: 50))]
private var gridItemLayout3 = [GridItem(.fixed(100)), GridItem(.fixed(150))]
private var gridItemLayout4 = [GridItem(.fixed(150)), GridItem(.adaptive(minimum: 50))]
@gurjitdhiman
gurjitdhiman / LazyGridDemo.swift
Created July 22, 2023 05:43 — forked from universeye/LazyGridDemo.swift
LazyVGrid & LazyHGrid
import SwiftUI
struct LazyVGridDemo: View {
private var symbols = ["keyboard", "hifispeaker.fill", "printer.fill", "tv.fill", "desktopcomputer", "headphones", "tv.music.note", "mic", "plus.bubble", "video"]
private var colors: [Color] = [.yellow, .purple, .green]
private var gridItemLayout1 = [GridItem(.flexible()), GridItem(.flexible()), GridItem(.flexible())]
private var sixColumnGrid: [GridItem] = Array(repeating: .init(.flexible()), count: 6)
private var gridItemLayout2 = [GridItem(.adaptive(minimum: 50))]
private var gridItemLayout3 = [GridItem(.fixed(100)), GridItem(.fixed(150))]
private var gridItemLayout4 = [GridItem(.fixed(150)), GridItem(.adaptive(minimum: 50))]