Inline
Last modified: 21 July 2022Language: Objective-C
Shortcut: ⌃ ⌥ N
The Inline refactoring lets you reverse the Extract refactoring for a method or variable.
Use the Inline refactoring to reverse the extract refactoring.
Place the caret at the code fragment you want to inline.
Press ⌃ ⌥ N. Alternatively, right-click the code fragment and go to the Refactor menu. Select the inline refactoring that you need.
In the dialog that opens, click View usages if you want to preview the refactoring results. To apply the changes, click Inline.
Below is the result of inlining a method.
Objective-CBefore
After
- (void)setupUI { // ... // This method will be inlined [self setupLabel]; } - (void)setupLabel { self.labelInfo.textColor = [UIColor blackColor]; self.labelInfo.text = @"Your email and password"; }
- (void)setupUI { // ... // Inlined code self.labelInfo.textColor = [UIColor blackColor]; self.labelInfo.text = @"Your email and password"; }
Thanks for your feedback!
Was this page helpful?