Skip to content

Instantly share code, notes, and snippets.

@keitaito
Created March 6, 2016 09:46
Show Gist options
  • Save keitaito/fe6d0d6f8d0bed2be9f5 to your computer and use it in GitHub Desktop.
Save keitaito/fe6d0d6f8d0bed2be9f5 to your computer and use it in GitHub Desktop.
How to get the class name of an object in Swift 2
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