Skip to content

Instantly share code, notes, and snippets.

@farhanpatel
Created October 23, 2017 23:16
Show Gist options
  • Save farhanpatel/469400e62fea7a40a19b6aadcc95d7b6 to your computer and use it in GitHub Desktop.
Save farhanpatel/469400e62fea7a40a19b6aadcc95d7b6 to your computer and use it in GitHub Desktop.
var extraEvents: [String: Any] = [:]
if let paramEvents = extra {
extraEvents = extraEvents.merging(paramEvents) { (_, new) in new }
}
if let extraString = description {
extraEvents = extraEvents.merging(["errorDescription": extraString]) { (_, new) in new }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment