This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"rules": { | |
"users" : { | |
"$user_id" : { | |
".read" : "auth != null && $user_id === auth.uid", | |
".write" : "auth != null && $user_id === auth.uid" | |
} | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// ContentView.swift | |
// SimpleAppStorageOnboarding | |
// | |
// Created by Tunde Adegoroye on 05/05/2022. | |
// | |
import SwiftUI | |
struct ContentView: View { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: [ |