Created
August 27, 2015 01:11
-
-
Save sgr-ksmt/10cbd68e6112d81a14c0 to your computer and use it in GitHub Desktop.
Get Class Name
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class GetClassName { | |
class func getClassName(obj: AnyObject) -> String? { | |
return NSStringFromClass(obj.dynamicType)?.componentsSeparatedByString(".").last | |
} | |
class func getClassName(aClass: AnyClass) -> String? { | |
return NSStringFromClass(aClass)?.componentsSeparatedByString(".").last | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Memo