While playing in a Swift playground I noticed that Self
, with capital \"S\", is available along with the lowercase self
. Is there any difference be
I understand Self as a type name(class name for example) and self as an instance of a class/struct , for example:
struct Person {
static var documentNumner = "9484930"
var name: String
var computedFullName: String {
return ("\(self.name) with document number: \(Self.documentNumner)")
}
}
You can't use self with a static property but you can use Self