Last active
February 24, 2019 21:11
-
-
Save Otbivnoe/ae357382b7d70e4e353e7b3c1c99c263 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
func printData(from keyPaths: KeyPath<[String: Any], Any?>...) { | |
keyPaths.forEach { keyPath in | |
print(dict[keyPath: keyPath]) | |
} | |
} | |
printData(from: \.name, \.age) | |
// Optional("Nikita") | |
// Optional(24) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment