I\'m trying to declare an argument in Swift that takes an optional closure. The function I have declared looks like this:
class Promise { func then(onFulfi
You should enclose the optional closure in parentheses. This will properly scope the ? operator.
?
func then(onFulfilled: ()->(), onReject: (()->())?){ if let callableRjector = onReject { // do stuff! } }