Skip to content

Instantly share code, notes, and snippets.

View BenShutt's full-sized avatar

Ben Shutt BenShutt

View GitHub Profile
@moyerr
moyerr / SwiftUINavigation.swift
Created July 7, 2023 17:17
A demonstration of navigation in SwiftUI using NavigationStack and Environment actions
import SwiftUI
// MARK: Navigation
enum Screen: String, Hashable, CaseIterable, CustomStringConvertible {
case first, second, third
var description: String {
rawValue.capitalized
}
//
// ValueWrapper.swift
// ADKATech.com
//
// Created by Amr Elghadban on 9/20/18.
// Copyright © 2018 Mobile DevOps. All rights reserved.
//
import Foundation
@AliSoftware
AliSoftware / Bindings.swift
Last active May 22, 2024 08:45
Re-implementation of @binding and @State (from SwiftUI) myself to better understand it
/*:
This is a concept re-implementation of the @Binding and @State property wrappers from SwiftUI
The only purpose of this code is to implement those wrappers myself
just to understand how they work internally and why they are needed,
⚠️ This is not supposed to be a reference implementation nor cover all
subtleties of the real Binding and State types.
The only purpose of this playground is to show how re-implementing
them myself has helped me understand the whole thing better