Skip to content

Instantly share code, notes, and snippets.

View DarrenHurst's full-sized avatar

Darren Hurst DarrenHurst

View GitHub Profile
@DarrenHurst
DarrenHurst / Theme
Created January 15, 2024 14:15
ThemeProtocol Builder
//
// File.swift
//
//
// Created by Darren Hurst on 2024-01-03.
//
import Foundation
import SwiftUI
@DarrenHurst
DarrenHurst / rbutton
Created January 2, 2024 13:39
Generic Button Swiftui
import Foundation
import SwiftUI
@available(iOS 16.0, *)
struct RenderButton: View, Identifiable {
var id : UUID = UUID()
var text: String?
var image: Image?
//
// tree2.swift
// Shop
//
// Created by Darren Hurst on 2023-12-23.
//
import Foundation
import SwiftUI
import SpriteKit
@DarrenHurst
DarrenHurst / tree.swift
Last active December 23, 2023 12:33
Fun Holiday Tree Sample Swift UI
// Gist one file for easy run
// snow.sks & fireflies.sks dependency
import Foundation
import SwiftUI
import SpriteKit
class Ornament: ObservableObject {
@Published var ornamentIndex: Int?
@Published var gif: (any View)?
@DarrenHurst
DarrenHurst / tree
Created December 9, 2023 13:29
#SWIFTUITREE
import Foundation
import SwiftUI
@available(iOS 16.0, *)
struct Tree: View {
@State var startAnimation: Bool = false
@State private var particleSystem = ParticleView()
var body: some View {
VStack {
buildTree().anyView
@DarrenHurst
DarrenHurst / gist:12f58a321c13086e8290d39476e35ab5
Created June 9, 2023 16:45
Playing around with swiftui animation
import Foundation
import SwiftUI
struct CircleText: View {
@State var controlAnimation: Bool = false
let title: String = "Nathan & Dylan Games "
var body: some View {
ZStack{
let characters = Array(title)
@DarrenHurst
DarrenHurst / FunView
Created March 27, 2023 20:13
A few simple animations on spot, and ms kitty.
import Foundation
import SwiftUI
@available(iOS 16.0, *)
struct AnimalPictures: View {
@State var profileImg: ProfileImgType = .teddybear
var body: some View {
VStack{
@DarrenHurst
DarrenHurst / PuppyVSPuppy
Last active March 24, 2023 17:26
A look a identifiable views.
import Foundation
import SwiftUI
@available(iOS 16.0, *)
struct AnimalPictures: View {
@State var profileImg: ProfileImgType = .teddybear
var body: some View {
VStack{
@DarrenHurst
DarrenHurst / FunView
Created March 23, 2023 01:02
@ViewBuilder different circle profile like images. Use: Build an avatar. switch to builder patter for components.
import Foundation
import SwiftUI
import PhotosUI
@available(iOS 16.0, *)
struct Photos: View {
var body: some View {
VStack{
VStack {
@DarrenHurst
DarrenHurst / ErrorExample
Created March 20, 2023 15:14
ErrorExample
import Foundation
import SwiftUI
import PhotosUI
@available(iOS 16.0, *)
struct Photos: View {
@ObservedObject var viewModel = PhotosModel()
@State var selectedItems: PhotosPickerItem?
enum ImageState {