Swift: Reflection API

The code here is based on this tutorial.

import UIKit

public class Store {
    let storesToDisk: Bool = true
}
public class BookStore: Store {
    let itemCount: Int = 10
}
public struct Bookmark {
    enum Group {
        case Tech
        case News
    }
    private let store = {
        return BookStore()
    }()
    let title: String?
    let url: NSURL
    let keywords: [String]
    let group: Group
}

let aBookmark = Bookmark(title: "Swift Tutorials", url: NSURL(string: "yahoo.com")!, keywords: ["Swift", "iOS", "OSX"], group: .Tech)

let aMirror = Mirror(reflecting: aBookmark)
print(aMirror.displayStyle)
print(aMirror.subjectType)

for case let (label?, value) in aMirror.children {
    print (label, value)
}

let closure = { (a: Int) -> Int in return a * 2 }
let bMirror = Mirror(reflecting: closure)
print(bMirror.displayStyle)

print(aMirror.subjectType)
print(Mirror(reflecting: 5).subjectType)
print(Mirror(reflecting: "Test").subjectType)
print(Mirror(reflecting: NSNull()).subjectType)

let cMirror = Mirror(reflecting: aMirror)
print(cMirror.displayStyle)
print(cMirror.subjectType)

for case let (label?, value) in cMirror.children {
    print (label, value)
}

swift