Created
March 6, 2016 09:46
-
-
Save keitaito/fe6d0d6f8d0bed2be9f5 to your computer and use it in GitHub Desktop.
How to get the class name of an object in Swift 2
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
struct Archvier<T: AnyObject> { | |
static func getStringOfClassName(object: T) -> String { | |
return String(T) | |
} | |
} | |
// NSStringFromClass() didn't work with my custom class, even it is a subclass of NSObject. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment