class Wesley: Developer {
let name = "Wesley de Groot"
let age = 33
let location: Location = .Netherlands
let languages: [Languages] = [.Dutch, .English]
let programmingLanguages = ["Swift", "Objective-C", "JavaScript", "PHP"]
let markup = ["HTML", "CSS", ""]
func details() -> String {
var details = ""
for detail in Mirror(reflecting: self).children {
guard let label = detail.label else { continue }
details.append("\(label.capitalized): \(detail.value)\n")
}
return details
}
}
print(Wesley().details())
// The above doesn't compile?
// Just add this "missing" code.
class Developer {
enum Location { case Netherlands }
enum Languages { case Dutch, English }
}
Or Run in SwiftFiddle.
What is @frozen
Hacker Stickers
Inspect
WesleyDeGroot.nl
![](https://camo.githubusercontent.com/efb53eb81f5d0b95578f395925cc2849346e5decad45760cd6981f03d7b753a8/68747470733a2f2f6869742e79687970652e6d652f6769746875622f70726f66696c653f757365725f69643d31323930343631)
![](https://camo.githubusercontent.com/29d3c05db653e045fce9c0cad2550528f0dcc40c99aadb7d5734c8e8f451e650/68747470733a2f2f73747265616b2d73746174732e64656d6f6c61622e636f6d2f3f757365723d307857444726686964655f626f726465723d7472756526646174655f666f726d61743d6a2d4d2d59)