AppCode 2017.3 Help

Extract Protocol

With the Extract Protocol refactoring you can create a new protocol based on the members of the current class. The created protocol will be implemented automatically.

Extracting a protocol

  1. Select a class in the Project view, Structure view, or place the caret anywhere within a class in the editor.
  2. On the main menu or on the context menu of the selection, choose Refactor | Extract | Protocol. The dialog box appears.
  3. Specify the name for the new protocol.
  4. Select the class members you want to be listed in the protocol in the members area.
  5. Click Extract to proceed.
  6. Click Refactor when ready. If AppCode shows you a Refactoring Preview in the Find tool window, review the suggested changes. To have the interface extracted and the proposed changes applied, click Do Refactor.
Last modified: 27 March 2018

See Also