AppCode 2022.2 Help

Inline

The Inline refactoring lets you reverse the Extract refactoring for a method or variable.

Use the Inline refactoring to reverse the extract refactoring.

  1. Place the caret at the code fragment you want to inline.

  2. Press ⌃ ⌥ N. Alternatively, right-click the code fragment and go to the Refactor menu. Select the inline refactoring that you need.

  3. In the dialog that opens, click View usages if you want to preview the refactoring results. To apply the changes, click Inline.

  4. Below is the result of inlining a method.

    Before

    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"; }
    Last modified: 21 July 2022