Skip to content

Instantly share code, notes, and snippets.

View Francescu's full-sized avatar

Francescu Santoni Francescu

View GitHub Profile
@Francescu
Francescu / Or operator
Created September 29, 2014 11:27
Python "or" equivalent in Swift - Operator
func |<T>(a:T?, b:T) -> T {
if a != nil {
return a!
}
return b
}
// You can test it in playground
var optional:String?