Skip to content

Instantly share code, notes, and snippets.

View shivammaggu's full-sized avatar
🏠
Working from home

Shivam Maggu shivammaggu

🏠
Working from home
View GitHub Profile
@shivammaggu
shivammaggu / UserDefaultsHelper.swift
Last active December 22, 2023 11:06
Using UserDefaults with Property Wrapper
import UIKit
// Protocol to check for Nil
protocol AnyOptional {
var isNil: Bool { get }
}
// Conforming nil check protocol to optional
extension Optional: AnyOptional {
var isNil: Bool {