Created
August 31, 2017 19:24
-
-
Save RockfordWei/6db50b2681ae598d9a79b33dbf2ab8df to your computer and use it in GitHub Desktop.
Swift 4 Struct Description
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
public struct Person { | |
public var name = "" | |
public var age = 0 | |
} | |
let rocky = Person(name: "rocky", age: 24) | |
print(rocky) | |
let mirror = Mirror(reflecting: rocky) | |
for (key, value) in mirror.children { | |
guard let k = key else { | |
continue | |
} | |
print(k, value) | |
} | |
print(Person.self) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment