I have code in obj-c
+(id)viewController { UIViewController *vc = [[self alloc]init]; return vc; } But I cannot reproduce this in swift code I try in this way
class func viewController()->UIViewController { return self(); } convenience override init () { var nibName = NSStringFromClass(self.dynamicType) // In this part I get err self.init(nibName:nibName,bundle:nil); } I cannot get self class name before init ... in obj-c its look like this
NSString *nibName = NSStringFromClass([self class]); self = [super initWithNibName:nibName bundle:nil];