How to Delete a project File in Xcode

In this tutorial, you will the simplest method of deleting a file using Xcode Project following this simple example.

How to delete a file manually in Xcode

The easiest way to remove a Swift file from your Xcode Project is by locating and then manually removing the file. Here are the steps to deleting a file manually with a visual example:

show navigator in Xcode

  1. Open the Navigation Pane and locate the file (If you can’t see the Navigation Pane, go to View → Navigators → Show/Hide Navigator, or simply press command/Ctrl + Zero (0) )
  2. Once you see the Navigation Pane, sort through the folders to find the file you want to delete, in this case, the TestFile.

How to Delete a project File in Xcode

3. To delete the file, simply select the file and press delete/backspace, or left-click on the file and then press delete.

This action will delete the file from the package and move it to the trash. If you are unfamiliar with the components of Xcode, follow this image

map of xcode

Want to explore more awesome functions using Swift? Visit our page Functions in Swift.

Leave a Reply

Your email address will not be published.