Skip to content

Instantly share code, notes, and snippets.

for (key, value) in components {
if (value === f) {
let component = components.removeValueForKey(key)
println(component)
break
}
}
@natecook1000
natecook1000 / Explore.swift
Last active December 8, 2015 15:25 — forked from erica/gist:06d7e44f4f834757dc36
Swift: Reflection dump
// Original by Erica Sadun
// Source: http://ericasadun.com/2014/06/24/swift-reflection-dump/
import UIKit
import Foundation
func typestring(x : Any) -> String
{
if let obj = x as? NSObject {
return NSStringFromClass((x as NSObject).dynamicType)
import Foundation
/*
Toying with tools to help read binary formats.
I've seen lots of approaches in swift that create
an intermediate object per-read (usually another NSData)
but even if these are lightweight under the hood,
it seems like overkill. Plus this taught me about <()>
*/