Given this sample Swift code:
var a = 10; func foo() -> Int { var a = 20; return a; }
How can function foo get access to global
Use the self keyword:
self
func foo() -> Int { var a = 20; return self.a; }