0

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]; 
2
  • Probably related: stackoverflow.com/questions/24107658/… Commented Dec 8, 2014 at 9:42
  • 1
    not exactly my problems is when I will use this I don't know childer controller name (Thats why I use self) Commented Dec 8, 2014 at 9:45

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.