View CowType.swift
// | |
// ContentView.swift | |
// CopyOnWrite | |
// | |
// Created by Ray Fix on 3/27/21. | |
// | |
import SwiftUI | |
struct CowType { |
View VolumeView.swift
// | |
// ContentView.swift | |
// Slider | |
// | |
// Created by Ray Fix on 2/20/21. | |
// | |
import SwiftUI | |
struct VolumeView: View { |
View PickerExample.swift
// | |
// ContentView.swift | |
// PickerDemo2 | |
// | |
// Created by Ray Fix on 1/23/21. | |
// | |
import SwiftUI | |
View SmallArrayEnum.swift
// A slitghtly silly example of a fixed array prototype | |
enum SmallArrayEnum<E>: RandomAccessCollection, MutableCollection { | |
init() { | |
self = .count0 | |
} | |
var startIndex: Int { 0 } | |
var endIndex: Int { |
View DataGrid.swift
// | |
// ContentView.swift | |
// DataGrid | |
// | |
// Created by Ray Fix on 11/14/20. | |
// | |
import SwiftUI | |
struct DataGrid<Element> { |
View PhotoPicker2.swift
// | |
// ContentView.swift | |
// PhotoPicker2 | |
// | |
// Created by Ray Fix on 10/31/20. | |
// | |
import SwiftUI | |
import PhotosUI | |
import UIKit |
View ImagePicker.swift
import SwiftUI | |
import PhotosUI | |
final class ViewModel: ObservableObject { | |
@Published var image: UIImage? | |
} | |
struct Spinner: UIViewRepresentable { | |
let isAnimating: Bool |
View PRNG.swift
// Algorithm from https://en.wikipedia.org/wiki/Permuted_congruential_generator | |
struct PRNG: RandomNumberGenerator { | |
var state: UInt64 = 0x4d595df4d0f33173 | |
let multiplier: UInt64 = 6364136223846793005 | |
let increment: UInt64 = 1442695040888963407 | |
init(seed: UInt64) { | |
state = seed &+ increment |
View mocking.swift
import Combine | |
struct Location { | |
} | |
//protocol WeatherService { | |
// func getTemperature(location: Location) -> AnyPublisher<Double, Error> | |
//} | |
// |
View EditDemo.swift
// | |
// ContentView.swift | |
// EditDemo | |
// | |
// Created by Ray Fix on 7/25/20. | |
// | |
import SwiftUI | |
// This is a hack! | |
func hideKeyboard() { |
NewerOlder