cuikun
(Cuikun)
1
func someMethod() {
var variable = "someString"
}
'who' has the referentce to the variable?
Avi
2
The function. Who else could have it?
cuikun
(Cuikun)
3
who has the reference to the function,how can I check for it?
By 'who has the reference', do you mean who own's the function or who is the caller of the function?
- If it's in a type then the type owns it, if it's not in the type then the module owns it and it's a global function (can be limited to the current file)
- In Xcode you can right click on the function and try 'Find Call Hierarchy'
cuikun
(Cuikun)
5
Is function and its owner's relationship a reference?
Functions are reference types like classes are also reference types in Swift, if that's what you've asked about.