Is it possible to get current executing function's name?

In other languages, I am able to get current function's name using some kind of so-called reflection API. Does Swift provide similar API?

Answered by endecotp in 769138022

Where do you want to display ?

Here is a solution to display in a Label..

  • Create a label in the View
     @IBOutlet weak var label        : UILabel!  

In the function you for which you want to display function name:

label.text = #function

Hope that helps

Accepted Answer
Is it possible to get current executing function's name?
 
 
Q