Skip to content

Instantly share code, notes, and snippets.

@cieslak
Created June 13, 2014 19:32
Show Gist options
  • Save cieslak/5d43f37d5a437549d3cd to your computer and use it in GitHub Desktop.
Save cieslak/5d43f37d5a437549d3cd to your computer and use it in GitHub Desktop.
Interrobang operator in Swift
import Foundation
operator postfix ‽ {}
@postfix func ‽<T>(value: T?) -> T? {
return (arc4random_uniform(2) == 1) ? value : nil
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment