Extra instructions when following @Luke-West's + @Vaiden's solutions:
- If your scheme has not changed (still showing my mac) on the top left next to the stop button:
- Click NEWLY created Project name (next to stop button) > Click Edit Schemes > Build (left hand side) > Remove the old target (will say it's missing) and replace with the NEWLY named project under NEWLY named project logo
Also, I did not have to use step 3 of @Vaiden's solution. Just running rm -rf Pods/
in terminal got rid of all old pod files
I also did not have to use step 9 in @Vaiden's solution, instead I just removed the OLD project named framework under Link Binary Libraries (the NEWLY named framework was already there)
So the updated steps would be as follows:
Step 1 - Rename the project
- If you are using cocoapods in your project, close the workspace, and open the XCode project for these steps.
- Click on the project you want to rename in the "Project navigator" on the left of the Xcode view.
- On the right select the "File inspector" and the name of your project should be in there under "Identity and Type", change it to the new name.
- Click "Rename" in a dropdown menu
Step 2 - Rename the Scheme
- In the top bar (near "Stop" button), there is a scheme for your OLD product, click on it, then go to "Manage schemes"
- Click on the OLD name in the scheme, and it will become editable, change the name
- Quit XCode.
- In the master folder, rename OLD.xcworkspace to NEW.xcworkspace.
Step 3 - Rename the folder with your assets
- Quit Xcode
- In the correctly named master folder, there is a newly named xcodeproj file with the the wrongly named OLD folder. Rename the OLD folder to your new name
- Reopen the project, you will see a warning: "The folder OLD does not exist", dismiss the warning
- In the "Project navigator" on the left, click the top level OLD folder name
- In Utilities pane under "Identity and type" you will see the "Name" entry, change this from the OLD to the new name
- Just below there is a "Location" entry. Click on a folder with the OLD name and chose the newly renamed folder
Step 4 - Rename the Build plist data
- Click on the project in the "Project navigator" on the left, in the main panel select "Build Settings"
- Search for "plist" in this section
Under packaging, you will see Info.plist, and Product bundle identifier
- Rename the top entry in Info.plist
- Do the same for Product Identifier
Step 5 Handling Podfile
- In XCode: choose and edit Podfile from the project navigator. You should see a target clause with the OLD name. Change it to NEW.
- Quit XCode.
- In terminal, cd into project directory, then:
pod deintegrate
- Run pod install.
- Open XCode.
- Click on your project name in the project navigator.
- In the main pane, switch to the Build Phases tab.
Under Link Binary With Libraries, look for the OLD framework and remove it (should say it is missing) The NEWLY named framework should already be there, if not use the "+" button at the bottom of the window to add it
- If you have an objective-c Bridging header go to Build settings and change the location of the header from OLD/OLD-Bridging-Header.h to NEW/NEW-Bridging-Header.h
- Clean and run.
You should be able to build with no errors after you have followed all of the steps successfully