Accessing global variable in Swift

后端 未结 3 1619
萌比男神i
萌比男神i 2021-01-18 09:34

Given this sample Swift code:

var a = 10;

func foo() -> Int {
    var a = 20;
    return a;
}

How can function foo get access to global

3条回答
提交回复
热议问题