Skip to content

Instantly share code, notes, and snippets.

View msaps's full-sized avatar

Merrick Sapsford msaps

View GitHub Profile
@msaps
msaps / ParkingLot.swift
Last active April 29, 2020 20:38
Parking Lots
import Foundation
enum VehicleClass {
case small
case medium
case large
}
class ParkingSlot: Hashable {
@msaps
msaps / ParkingLot.swift
Created April 29, 2020 20:04
Parking Lots
import Foundation
class ParkingSlot {
let id = UUID().uuidString
let price: Int
init(price: Int) {
self.price = price
}
}
[
{
"name": "Sublime Vivid",
"colors": ["#FC466B", "#3F5EFB"]
},
{
"name": "Rainbow Blue",
"colors": ["#00F260", "#0575E6"]
},
{
@msaps
msaps / Enum+All.swift
Created October 8, 2017 15:04
Swift 4 Enum+All
import Foundation
protocol EnumCollection: Hashable {
static var all: [Self] { get }
}
extension EnumCollection {
static func cases() -> AnySequence<Self> {
typealias SelfType = Self