Table of contents

Rename or refactor in Xcode

IDE Feb 21, 2020 Viewed 368 Comments 0

In xcode, there are several methods for batch modifying variable names, file names, class names, protocol names, and so on.

Keyboard Shortcut

Select or position the mouse over the variable name you want to modify. Keyboard Shortcut Control - Command - E 

xcode种使用Control - Command - E快捷键修改变量名称

Xcode automatically highlights these variables. This is the shortcut for Edit All in Scope.

xcode edit all in scope key bingdings


Select or position the mouse to the variable name, interface name, implementation name, or protocol name that you want to modify, and select the menu Editor -> Refator -> Rename. The editor will display a preview of the changes, including the project's code, file name, and comment content. Click Rename in the upper right corner to batch rename.

xcode Editor -> Refator -> Rename修改项目的所有引用

Updated Feb 21, 2020