Created
September 9, 2020 14:55
-
-
Save fortmarek/8dd3f2b3344419a9eb4a7fe1fc39e46d to your computer and use it in GitHub Desktop.
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
extension Scaffold: CustomReflectable { | |
var customMirror: Mirror { | |
// #1 | |
let attributesChildren: [Mirror.Child] = Scaffold.attributes | |
// #2 | |
.map { | |
(name: $0, option: Option<String>(name: .shortAndLong)) | |
} | |
// #3 | |
.map { | |
Mirror.Child(label: $0.name, value: $0.option) | |
} | |
// #4 | |
let children = [ | |
Mirror.Child(label: "template", value: _template), | |
] | |
// #5 | |
return Mirror(Scaffold(), children: children + attributesChildren) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment