Post

Replies

Boosts

Views

Activity

How can I get name of variable (it is an object) as string at runtime in Swift?
class Employee { func calculateSalary() { -> how can I print name of the variable call in this function? } } Example: let johnny = Employee() johnny.calculateSalary() -> It will print "johnny" in function calculateSalary()
Replies
3
Boosts
0
Views
1.3k
Activity
Oct ’23