Skip to content

Instantly share code, notes, and snippets.

View gurjitdhiman's full-sized avatar
:octocat:

Gurjit Singh gurjitdhiman

:octocat:
View GitHub Profile
@gurjitdhiman
gurjitdhiman / ARCBridge.h
Created July 4, 2017 06:38 — forked from MaddTheSane/ARCBridge.h
A header for bridging between ARC and non-ARC code, I.E., 32- vs. 64-bit OS X.
#ifndef PPMacho_ARCBridge_h
#define PPMacho_ARCBridge_h
#include <AvailabilityMacros.h>
#if __has_feature(objc_arc)
#define SUPERDEALLOC
#define RELEASEOBJ(obj)
#define RETAINOBJ(obj) obj
#define RETAINOBJNORETURN(obj)
@gurjitdhiman
gurjitdhiman / SwiftUIInputAlert.swift
Last active July 20, 2023 12:14
Show Input Text Fields in SwiftUI Alerts with Form Validations.
//
// SwiftUIInputAlert.swift
// Swity Notes
//
// Created by Gurjit's Macbook on 20/07/23.
//
import SwiftUI
struct SwiftUIInputAlert: View {
@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))]