swift function calls: self-keyword vs without

function, self, swift

Solution

In most cases: there is absolutely no difference. But it's more "swiftish" if you omit "self". But there is a case, when you have to use self: in closure expressions.

But since Swift 1.2, with the @noescape parameter, you can omit "self" in closures as well.

Problem

I was wondering if there is any difference between those two a function-calls in a class: ``` self.myFuction() ``` VS ``` myFunction() ``` it is working in both ways. Is there the case where it's necessary to use the self-keyword?

Original source