I'm trying to get the class name from within a class method in an extension. Is this possible? I end up with "DRHT" as the name of the class
extension
extension UIViewController {
public class func instanceFromStoryboard(storyboardIdentifier: String = "Main") -> UIViewController {
let storyboard = UIStoryboard(name: storyboardIdentifier, bundle: nil)
let controllerIdentifier = NSStringFromClass(self)
return storyboard.instantiateViewControllerWithIdentifier(controllerIdentifier) as UIViewController
}
}
Usage
let homeViewController = HomeViewController.instanceFromStoryboard()