I am using self.classForCoder
to log class name using print statement.
I want to log class name in class methods as well without hard-coding. Is there any dynamic way like self.classForCoder
to log class name in class method as well?
Use "\(self)"
to log the class name without hard coding it:
class Test {
class func printClassName() {
print("\(self)")
}
}
Test.printClassName()
Test
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments