advantis
6/30/2014 - 1:31 PM

Swift null coalescing operator

Swift null coalescing operator

operator infix || {}
@infix func ||<T>(lhs: T?, rhs: T) -> T {
    return lhs ? lhs! : rhs
}