Skip to content

Instantly share code, notes, and snippets.

@jemmons
jemmons / StateMachine.swift
Last active March 13, 2023 14:59
A Simple Swift State Machine
import Foundation
class StateMachine<P:StateMachineDelegateProtocol>{
private unowned let delegate:P
private var _state:P.StateType{
didSet{
delegate.didTransitionFrom(oldValue, to:_state)
}
}
@jemmons
jemmons / #dotfiles
Last active February 23, 2021 02:38
Configuration dotfiles for various command line tools.
# Configuration dotfiles for various command line tools.