How to make ViewController load itself from nib on viewDidLoad() properly?

Viewed 65

So I have a nib file for my CustomViewController and every time I want to present this Controller I do

    let vc = CustomViewController(nibName: "CustomViewController", bundle: nil)
    self.present(vc, animated: true, completion: nil)

What I want is to make CustomViewController to load itself from nib by itself. So that the call in the parent VC would be like this

    let vc = CustomViewController()
    self.present(vc, animated: true, completion: nil)
2 Answers
Related