Rename refactoring allows you to rename symbols, files, and directories globally with all the references to them in the code corrected automatically.
Renaming local variables or private methods can be done easily inline since only the limited scope is affected. Renaming classes or public methods could potentially impact a lot of files. In this case, we suggest that you preview potential changes before you refactor.
Rename a symbol
Select an item to be renamed in the editor or in the Structure tool window ⌥ 7.
Selectfrom the main or context menu or press ⇧ F6. The selected symbol gets highlighted and you can type a new name in the highlighted area.
AppCode displays and (for Objective-C) next to the highlighted element.
You can click these icons or press Tab to open the context menu and select the additional rename options.
Comments and strings: the occurrences of the symbol will be also renamed in comments and string literals.
Text occurrences (Objective-C): the occurrences of the symbol will be also renamed in files that don't contain any source code (documentation, text files, HTML files, and so on).
If you want to change other refactoring options or preview the refactoring results, click the More options link or press ⇧ F6. In the dialog that opens, you can select the refactoring scope and click Preview to preview the changes in a separate tool window before applying them.
Rename a file
Select a desired file in the Project tool window.
Chooseon the main or context menu or press ⇧ F6.
In the Rename dialog that opens, specify the new filename.
Select the Search in comments and strings checkbox to let AppCode apply changes to comments and strings.
Change the refactoring scope in the corresponding field if needed.
Click Preview to observe possible changes in Find Tool Window. Click Refactor to proceed.
AppCode finds all the occurrences of the filename and changes them respectively.