here is a scenario
func callingMethod_A { self.someCalculation() } func callingMethod_B{ self.someCalculation() } func someCalculation{ //how to find who
You can use Thread.callStackSymbols like this
func callingMethod_A() { self.someCalculation() } func callingMethod_B(){ self.someCalculation() } func someCalculation(){ let origin = Thread.callStackSymbols print(origin[0]) print(origin[1]) }