Let us say that our view controller is called as: mainViewController.
In order to make the mainViewController as our root view controller follow the steps below:
Step 01 : we have to include the following code inside the application (didFinishLaunchingWithOptions) function in our AppDelegate.swift file .
let mainVC = mainViewController()
window = UIWindow()
window?.rootViewController = mainVC
window?.makeKeyAndVisible()
Step 02: Delete the Main.storyboard file
step 03: Click your project. Go to Targets > General> Main interface. Delete the word ‘Main’.
Now run the application.Your custom view controller will be set as the root view controller.