Objective-C
ViewController * viewController = [[ViewController alloc] init];
ViewController.m
- (id) init
{
self = [super initWithNibName: @"nibName"
bundle: nil];
return self;
}
Swift
let viewController = ViewController()
ViewController.swift
override init!( nibName nibNameOrNil: String?,
bundle nibBundleOrNil: NSBundle? )
{
super.init( nibName: nibNameOrNil,
bundle: nibBundleOrNil )
}
convenience init()
{
self.init( nibName: "nibName",
bundle: nil )
}
required init?( coder: NSCoder )
{
fatalError( "not implemented" )
}