Created
September 18, 2014 18:47
-
-
Save morizotter/a59c36eae5105e3493a9 to your computer and use it in GitHub Desktop.
Swiftでクラス名を取得するメソッドを書いてみた ref: http://qiita.com/morizotter/items/9739d789d69924fd1897
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 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