I had a TestViewController.swift
and a TestViewController.xib
presenting the layout of TestViewController.
To load this view controller I had this method:
let vc = TestViewController(nibName: "TestViewController", bundle: nil)
self.navigationController?.pushViewController(vc, animated: true)
Everything works well, but if I call empty initializer:
let vc = TestViewController()
self.navigationController?.pushViewController(vc, animated: true)
Or with nil nibname
let vc = TestViewController(nibName: nil, bundle: nil)
self.navigationController?.pushViewController(vc, animated: true)
The application also continues to work without changes. What's the point in explicitly specifying the name of the xib file? What is the difference between three calls in this case?