This file contains hidden or 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 | |
// Xcode: 16.0 | |
// Swift: 6.0 | |
struct EnumPicker<Enum>: View where Enum: CaseIterable & Hashable, Enum == Enum.AllCases.Element, Enum.AllCases: RandomAccessCollection { | |
@Binding var selection: Enum | |
var body: some View { | |
Picker(String(describing: Enum.self), selection: $selection) { | |
ForEach(Enum.allCases, id: \.self) { value in |
This file contains hidden or 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 Foundation | |
class StreamReader { | |
let encoding: String.Encoding | |
let chunkSize: Int | |
let fileHandle: FileHandle | |
var buffer: Data | |
let delimPattern : Data | |
var isAtEOF: Bool = false | |