Skip to content

Instantly share code, notes, and snippets.

View tunds's full-sized avatar

tundsdev tunds

View GitHub Profile
{
"rules": {
"users" : {
"$user_id" : {
".read" : "auth != null && $user_id === auth.uid",
".write" : "auth != null && $user_id === auth.uid"
}
}
}
}
@tunds
tunds / AppStorage+SheetExample.swift
Created May 5, 2022 09:26
Simple Example Appstorage and presenting sheet
//
// ContentView.swift
// SimpleAppStorageOnboarding
//
// Created by Tunde Adegoroye on 05/05/2022.
//
import SwiftUI
struct ContentView: View {
import Foundation
import SwiftData
actor ItemsContainer {
@MainActor
static func create(shouldCreateDefaults: inout Bool) -> ModelContainer {
let schema = Schema([Item.self])
let isPaidUser = true // Write your logic here to see if they've paid or not
let configuration = ModelConfiguration(cloudKitDatabase: isPaidUser ? .automatic : .none)
@tunds
tunds / AnimatingMeshView.swift
Created September 17, 2024 05:43 — forked from davidsteppenbeck/AnimatingMeshView.swift
Animating mesh gradient for iOS 18 using TimelineView
import SwiftUI
struct AnimatingMeshView: View {
let referenceDate: Date
var body: some View {
TimelineView(.animation) { context in
let t = context.date.timeIntervalSince(referenceDate)
MeshGradient(width: 5, height: 4, points: [