Change All Variable References with Xcode ‘Edit All in Scope’

Xcode offers a handy way to highlight and edit all references to a variable within the current scope. Here are the steps:

First, make sure you have the setting shown below enabled within the Text Editing tab in the Xcode Preferences:

Xcode Edit All in Scope

Double tap a variable name and keep the cursor over the marked text. A drop down arrow will appear to the right of the variable.

Xcode Edit All in Scope

Selecting the dropdown arrow will show a list of options, choose Edit All in Scope:

Xcode Edit All in Scope

Xcode will highlight all references to the variable name:

Xcode Edit All in Scope

At this point you can edit the variable name and all changes will cascade through each variable reference:

Xcode Edit All in Scope

Comments are closed.

  • Related Content by Tag