Skip to content

Instantly share code, notes, and snippets.

@susieyy
Created January 14, 2017 02:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save susieyy/c8d4f08aa270e5eb08c7400bd15298be to your computer and use it in GitHub Desktop.
Save susieyy/c8d4f08aa270e5eb08c7400bd15298be to your computer and use it in GitHub Desktop.
#swtws
extension UIViewController {
func screenName() -> String {
let subjectType = Mirror(reflecting: self).subjectType
let className = "\(subjectType)"
let screenName = className.stringByReplacingOccurrencesOfString("ViewController", withString: "")
return screenName
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment