In Objective C you can log the method that is being called using:
NSLog(@\"%s\", __PRETTY_FUNCTION__)
Usually this is used from a logging m
Swift 3.x+
If you don't want the entire file name then here's a quick fix for that.
func trace(fileName:String = #file, lineNumber:Int = #line, functionName:String = #function) -> Void {
print("filename: \(fileName.components(separatedBy: "/").last!) function: \(functionName) line: #\(lineNumber)")
}
filename: ViewController.swift function: viewDidLoad() line: #42