Skip to content

Instantly share code, notes, and snippets.

@ZevEisenberg
Created November 29, 2017 21:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ZevEisenberg/66cd1f8aa25d34a3f22b85e933fa4ac8 to your computer and use it in GitHub Desktop.
Save ZevEisenberg/66cd1f8aa25d34a3f22b85e933fa4ac8 to your computer and use it in GitHub Desktop.
Convert a dictionary’s keys from NSAttributedStringKey to String
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