Extract property
Last modified: 07 December 2022Language: Objective-C
Shortcut: Ctrl+Alt+E
The Extract Property refactoring lets you move expressions and local declarations to properties.

Extract a property
In the editor, select the expression or declaration you want to replace with a property.
Press Ctrl+Alt+E or select Refactor | Extract/Introduce | Property from the main or context menu.
If there are several expressions available for extracting, select the required one from the list that opens and press Enter.
Select a name for the property from the list of suggestions that opens or type a new one.
If you want the property to be generated in a private category, select the Put to private category checkbox. Otherwise, the property will be declared in the header file.
Press Enter.
Before | After |
---|---|
|
|
Thanks for your feedback!