Skip to content

Instantly share code, notes, and snippets.

View nathantannar4's full-sized avatar

Nathan Tannar nathantannar4

View GitHub Profile
import UIKit
protocol IView: AnyObject where Self: UIView {
func viewDidLoad()
func viewWillAppear(_ animated: Bool)
func viewDidAppear(_ animated: Bool)
func viewWillDisappear(_ animated: Bool)
func viewDidDisappear(_ animated: Bool)
}
//
// Copyright (c) Nathan Tannar
//
import SwiftUI
import Engine // https://github.com/nathantannar4/Engine
import Turbocharger // https://github.com/nathantannar4/Turbocharger
import Transmission // https://github.com/nathantannar4/Transmission
#if os(iOS)
@nathantannar4
nathantannar4 / Run an animation when a value changes
Created August 25, 2023 06:51
SwiftUI ChangeEffect ViewModifier
import SwiftUI
struct ContentView: View {
@State var counter: Int = 0
var body: some View {
VStack(spacing: 24) {
Image(systemName: "exclamationmark.triangle.fill")
.font(Font.system(size: 50))