Skip to content

Instantly share code, notes, and snippets.

@Otbivnoe
Last active February 24, 2019 21:11
Show Gist options
  • Save Otbivnoe/ae357382b7d70e4e353e7b3c1c99c263 to your computer and use it in GitHub Desktop.
Save Otbivnoe/ae357382b7d70e4e353e7b3c1c99c263 to your computer and use it in GitHub Desktop.
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