I believe that you just need to wrap the closure type in parentheses, for example:
var respondToButton:((sender: UIButton) -> Bool)?
Alternatively, if this is the closure type that you often use, you can create typealias to make it more readable:
typealias buttonResponder = (sender: UIButton) -> Bool
then in your class:
var respondToButton:buttonResponder?
Jiaaro Jun 11 '14 at 18:47 2014-06-11 18:47
source share