Skip to content

Instantly share code, notes, and snippets.

@Boerworz
Created December 22, 2015 16:50
Show Gist options
  • Save Boerworz/dd71f00ba7fedcff240d to your computer and use it in GitHub Desktop.
Save Boerworz/dd71f00ba7fedcff240d to your computer and use it in GitHub Desktop.
func boxed() -> [UnboxableDictionary] {
return flatMap {
guard let boxable = $0 as? Boxable else {
return nil
}
return boxable.boxed()
}
}
// or
func boxed() -> [UnboxableDictionary] {
return flatMap { ($0 as? Boxable)?.boxed() }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment