infix operator ?= { precedence 90 }
func ?= <T> (inout f: T, optional:T?){
let _ = optional.flatMap{f = $0}
}
Usage looks like:
store.name ?= json["name"]?.string
Replaces this:
if let name = json["name"]?.string{
store.name = name
}