Skip to content

Instantly share code, notes, and snippets.

Avatar
🐰
🐰🐰🐰🐰🐰🐰🐰🐰🐰

Michael Critz mcritz

🐰
🐰🐰🐰🐰🐰🐰🐰🐰🐰
View GitHub Profile
View dabblet.css
body {
font-family: sans-serif;
}
ul {
list-style: none
}
li {
background: slategrey;
@mcritz
mcritz / EquatableThroughMirror.swift
Last active Feb 18, 2020
EquatableThroughMirror: compare two Types and return true if their properties and values are identical
View EquatableThroughMirror.swift
import Foundation
/// Create a custom operator
infix operator =≈=
/// Equatable through introspection
/// Compares lhs to rhs and returns true of both sides have the same property names and values
/// - Parameters:
/// - lhs: lefthand side
/// - rhs: righthand side
func =≈= <T>(lhs: T, rhs: T) -> Bool {
You can’t perform that action at this time.