Skip to content

Instantly share code, notes, and snippets.

View nikolaknez's full-sized avatar
💭
making things happen

Nikola Knezevic, MPh, PgMP, SPC, SCM,PMP, MSP nikolaknez

💭
making things happen
View GitHub Profile
@nikolaknez
nikolaknez / AnimatedPresence.swift
Last active May 27, 2026 14:59
AnimatedPresence.swift
import SwiftUI
/// A narrow layout that replaces `VStack` in row scenes — when some children may collapse
/// to zero height, **adjacent spacing is also continuously scaled by presence progress**,
/// so that the final stage of collapse does not produce an un-animated spacing jump.
///
/// ## Why not just use VStack
///
/// `VStack(spacing: x)` spacing is an unconditional promise from the parent to all children:
/// regardless of whether a child's current height is zero, adjacent gaps are always
@nikolaknez
nikolaknez / PurchaseManager.swift
Created August 2, 2025 19:02 — forked from lienmt/PurchaseManager.swift
PurchaseManager with SwiftUI & StoreKit
import Foundation
import StoreKit
enum ProductsId: String {
case subsWeekly24 = "WeeklyId"
case subsAnnual24 = "AnnualId"
}
@MainActor
class PurchaseManager: NSObject, ObservableObject {