Skip to content

Instantly share code, notes, and snippets.

@morizotter
Created September 18, 2014 18:47
Show Gist options
  • Save morizotter/a59c36eae5105e3493a9 to your computer and use it in GitHub Desktop.
Save morizotter/a59c36eae5105e3493a9 to your computer and use it in GitHub Desktop.
Swiftでクラス名を取得するメソッドを書いてみた ref: http://qiita.com/morizotter/items/9739d789d69924fd1897
class func className() -> String {
var className = NSStringFromClass(self)
var range = className.rangeOfString(".")
return className.substringFromIndex(range!.endIndex)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment