Skip to content

Instantly share code, notes, and snippets.

View DarrenHurst's full-sized avatar

Darren Hurst DarrenHurst

View GitHub Profile
@DarrenHurst
DarrenHurst / StringGenerics
Created January 26, 2023 15:22
String Generics, Regexp and Interpolation
//
// StringGenerics.swift
//
// Created by Darren Hurst on 2023-01-26.
//
import Foundation
extension String {
@DarrenHurst
DarrenHurst / LoginView
Created January 26, 2023 16:13
Basic Username Password Button Example.
//
// login.swift.swift
// RTSPStreamer
//
// Created by Darren Hurst on 2023-01-20.
//
import Foundation
import SwiftUI
@DarrenHurst
DarrenHurst / gist:d283621a8256429979ea06e0906a6ebc
Created January 27, 2023 14:52
Page. a simple router replacement
//
// Page returns a standard page with a color and conserves .light and .dark
// colorScheme
//
//
//
import Foundation
import SwiftUI
@DarrenHurst
DarrenHurst / StoreFront
Created February 4, 2023 12:04
SwiftUI MVVM Example
//
// Created by Darren Hurst on 2023-02-03.
//
import Foundation
import SwiftUI
struct Storefront: View {
@ObservedObject var view = ViewModel()
@DarrenHurst
DarrenHurst / gist:52e10d91556d4df697a651ee0a9ea5b3
Created February 5, 2023 20:31
SwiftUI Burger Builder Sample - patterns
//
// CartView.swift
// RTSPStreamer
//
// Created by Darren Hurst on 2023-02-05.
//
import Foundation
import SwiftUI
@DarrenHurst
DarrenHurst / BurgerView
Created February 6, 2023 03:56
Burger Builder Animated
//
// CartView.swift
// RTSPStreamer
//
// Created by Darren Hurst on 2023-02-05.
//
import Foundation
import SwiftUI
@DarrenHurst
DarrenHurst / BurgerBuilder
Created February 7, 2023 12:16
Buttons - Burger Builder - Part 2 passing builder types
//
// CartView.swift
// RTSPStreamer
//
// Created by Darren Hurst on 2023-02-05.
//
import Foundation
import SwiftUI
@DarrenHurst
DarrenHurst / FlightCenter
Created February 8, 2023 22:49
MVVM Builder Sample Animated background - spring
//
// FlightCenter.swift
// RTSPStreamer
//
// Created by Darren Hurst on 2023-02-07.
//
import Foundation
import SwiftUI
import CoreLocation
@DarrenHurst
DarrenHurst / BackButton
Created February 9, 2023 18:49
BackButton Control, installs as modifier .backButton()
import Foundation
import SwiftUI
struct BackButton: View {
var dismissAction: () -> Void
var btnBack : some View { Button(action: {
self.dismissAction()
}) {
@DarrenHurst
DarrenHurst / Hotdog.playground
Created February 11, 2023 17:30
Find the lowest priced hotdog
import UIKit
struct Item: Equatable {
var name: String?
var price: Double?
}
class a : ObservableObject {
@Published var items: [Item] = [
Item(name: "hotdogs", price:3.99),