I'm trying to do something that I thought was simple: Dismiss my view and do a delegate call in the completion.
This compiles fine:
dismissViewControllerAnimated(true, completion:nil)
self.delegate?.accountCreated(self.account)
So does this:
dismissViewControllerAnimated(true, completion: { () -> Void in
let tester = Account()
})
self.delegate?.accountCreated(self.account)
However, this is giving an error:
dismissViewControllerAnimated(true, completion: { () -> Void in
self.delegate?.accountCreated(self.account)
})
Error on the dismissViewControllerAnimated call: Cannot convert the expression's type '(BooleanLiteralConvertible,completion:() -> Void)' to type 'Void'
I don't understand why I'm getting this error. (Xcode 6.1b2)