Objective C中的写法
TwoViewController *v = [[TwoViewController alloc] init]; //这样会把TwoViewController默认关联到TwoViewController.xib上 //等同调用了方法 TwoViewController *v = [[TwoViewController alloc] initWithNibName:@"TwoViewController" bundle:nil];
Swift中的写法
let v = TwoViewController() //不会关联TwoViewController.xib文件 //一定要指定xib文件 let v = TwoViewController(nibName: "TwoViewController", bundle: nil)