I find it difficult to understand the problem that I am experiencing. To simplify, I will use the UIView method. Basically, if I write a method
UIView.animateWithDuration(1, animations: {() in }, completion:{(Bool) in println("test") })
It works great. Now, if I make the same method, but by creating a line like this:
UIView.animateWithDuration(1, animations: {() in }, completion:{(Bool) in String(23) })
It stops working. Compiler Error: Missing argument for delay parameter when invoked
Now, here is the weird part. If I do the same code as the one that fails, but just add a print command like this:
UIView.animateWithDuration(1, animations: {() in }, completion:{(Bool) in String(23) println("test") })
it will start working again.
My problem is basically the same. My code is:
downloadImage(filePath, url: url) { () -> Void in self.delegate?.imageDownloader(self, posterPath: posterPath) }
Does not work. But if I move on.
downloadImage(filePath, url: url) { () -> Void in self.delegate?.imageDownloader(self, posterPath: posterPath) println("test") }
or even:
downloadImage(filePath, url: url) { () -> Void in self.delegate?.imageDownloader(self, posterPath: posterPath) self.delegate?.imageDownloader(self, posterPath: posterPath) }
It works great. I do not understand why this is happening. I almost agree that this is a compiler error.