Skip to content

Instantly share code, notes, and snippets.

View thomasneuteboom's full-sized avatar

Thomas Neuteboom thomasneuteboom

View GitHub Profile
@mcmurrym
mcmurrym / MirrorDebugDecscription.swift
Last active December 24, 2019 05:59
A default protocol implementation for CustomDebugStringConvertible that uses Mirror for introspection
public extension CustomDebugStringConvertible {
var debugDescription: String {
return debugDescription()
}
func debugDescription(_ indentationLevel: Int = 0, includeType: Bool = true) -> String {
let indentString = (0..<indentationLevel).reduce("") { tabs, _ in tabs + "\t" }
var s: String