Copy and Move Refactorings
Copy
The Copy refactoring lets you create a copy of a file or directory in a different or the same directory.
Select a file/directory in the Project tool window.
Select
from the main or context menu or press F5.In the Copy window, specify the name and location for your copy and click OK.
Move
The Move refactoring lets you move declarations and class members to another file/class and files/directories to another directory.
Move a file/directory
Select a file/directory in the Project tool window.
Select
from the main or context menu or press F6.In the Move dialog, specify a directory where the selected file will be moved to:
To have references to the selected file or folder updated according to the refactoring result, select the Search for references checkbox.
Select Open moved members in editor if you want AppCode to open the files that have been moved.
Click OK.
Move a declaration/member (Objective-C)
Place the caret at the class, protocol, or member you want to move.
Select
from the main or context menu or press F6.In the invoked dialog, select declarations/members you want to move and specify a new class name:
The members that will be affected by this refactoring are highlighted in red.
Click Move. If necessary, click Preview to preview the potential changes.
If you are moving a method that uses some members of the current class, you will get a notification that these members will be inaccessible in the moved code.
If a method that you are moving is used by some members of the current class, you will be warned that the moved code will be inaccessible from these members.
Click Continue to perform the refactoring ignoring the warnings or Show Conflicts in View to open the conflicts in a dedicated view and fix them.
When you are moving
private
members, AppCode will suggest to escalate their visibility level:Click Yes if you want to accept the suggested changes or No if you want to edit the code later.