Created
November 29, 2017 21:57
-
-
Save ZevEisenberg/66cd1f8aa25d34a3f22b85e933fa4ac8 to your computer and use it in GitHub Desktop.
Convert a dictionary’s keys from NSAttributedStringKey to String
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 Dictionary where Key == NSAttributedStringKey { | |
var withStringKeys: [String: Value] { | |
return reduce(into: [:], { | |
$0[$1.key.rawValue] = $1.value | |
}) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment