less than 1 minute read

Xcode by default provides default name for the view controllers depending upon on the selected projects templates. For example, while creating Tabbed Application, you will find FirstViewController and SecondViewController as the name for default view controllers.

NewImage

Now if you want to provide a proper name to the FirstViewControllers and SecondViewControllers you can use the Rename option available under the Edit menu.

To rename FirstViewController,  

Step 1: Navigate to FirstViewController.h and select the name after interface keyword.

NewImage 

Step 2: Click the Edit menu then Refactor and select Rename from the list of available option.

NewImage

Step 3: Enter the name then select Rename related files and click the Preview button. This would display the list of files and location where the rename would affect.

Step 4: If you are happy with Preview then save the changes.

NewImage

By this way you can rename the default view controller and their related files (.h, .m and XIB) in Xcode.

Need iOS Help?

I help developers and founders with:

  • New apps — idea to App Store
  • Bug fixes, debugging & rescue
  • App Store rejections
  • Code review & mentoring
See how we can work together →

10+ years iOS • 10+ published apps • 11,000+ students trained

Updated: