How do we print variable name in swift? It's similar to what this question discusses Get a Swift Variable's Actual Name as String I can't figure out from above QA how to print it in swift for my need as described below
struct API {
static let apiEndPoint = "example.com/profile?"
static let apiEndPoint1 = "example.com/user?"
}
doSomething(endPoint: API.apiEndPoint)
doSomething(endPoint: API.apiEndPoint1)
func doSomething(endPoint: String) {
// print the variable name which should be apiEndPoint or endPoint1
}