class Person: NSObject {
var name = "John"
func greeting() {
let message = "Hello \(self.name)"
print(message)
}
}
take a look In greeting method of Persion class.
I'm using self.name that let me get clear "Im using instance variable now not local variable"
Is it a good way to access instance variable with self? If I use a lot.