View DemoLister.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// ContentView.swift | |
// DemoLister | |
// | |
// Created by Ray Fix on 12/11/21. | |
// | |
import SwiftUI | |
import IdentifiedCollections |
View boolean-sequences.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extension Sequence where Element: Comparable { | |
static func ==(_ lhs: Self, _ rhs: Element) -> LazyMapSequence<Self, Bool> { | |
lhs.lazy.map { $0 == rhs } | |
} | |
static func !=(_ lhs: Self, _ rhs: Element) -> LazyMapSequence<Self, Bool> { | |
lhs.lazy.map { $0 != rhs } | |
} | |
static func <(_ lhs: Self, _ rhs: Element) -> LazyMapSequence<Self, Bool> { |
View CowType.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// ContentView.swift | |
// CopyOnWrite | |
// | |
// Created by Ray Fix on 3/27/21. | |
// | |
import SwiftUI | |
struct CowType { |
View VolumeView.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// ContentView.swift | |
// Slider | |
// | |
// Created by Ray Fix on 2/20/21. | |
// | |
import SwiftUI | |
struct VolumeView: View { |
View PickerExample.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// ContentView.swift | |
// PickerDemo2 | |
// | |
// Created by Ray Fix on 1/23/21. | |
// | |
import SwiftUI | |
View SmallArrayEnum.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// ContentView.swift | |
// DataGrid | |
// | |
// Created by Ray Fix on 11/14/20. | |
// | |
import SwiftUI | |
struct DataGrid<Element> { |
View PhotoPicker2.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// ContentView.swift | |
// PhotoPicker2 | |
// | |
// Created by Ray Fix on 10/31/20. | |
// | |
import SwiftUI | |
import PhotosUI | |
import UIKit |
View ImagePicker.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import SwiftUI | |
import PhotosUI | |
final class ViewModel: ObservableObject { | |
@Published var image: UIImage? | |
} | |
struct Spinner: UIViewRepresentable { | |
let isAnimating: Bool |
View PRNG.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 |
NewerOlder