AppCode 2022.2 Help

UML class diagrams

AppCode lets you generate UML diagrams for Objective-C and Swift. The diagrams help you analyze the structure of your application by showing types, their connections, methods, and fields.

View class diagram

  • In the Project tool window, right-click a file for which you want to create a diagram and select Diagrams | Show Diagram ⌃ ⌥ ⇧ U or Diagrams | Show Diagram Popup (⌃ ⌥ U).

  • In the editor, place the caret at the symbol that you want to show on a diagram and from the context menu, select Diagrams | Show Diagram.

View local changes as a diagram

You can use the UML Class diagram to evaluate how your local code changes affect the application.

  • From the context menu of the code editor, the Project tool window, or the Local Changes view, select Show Local Changes as UML, or press ⌃ ⌥ ⇧ D.

    The diagram opens in a popup. You can double-click a node to view changes in a Differences viewer.

To view changes in revisions as a UML Class diagram, in the History tab of the Version Control tool window, select the desired revision and select Show Diff as UML from the context menu or press ⌃ ⇧ D.

Find a diagram element

  1. In the diagram editor, press ⌃ F12.

  2. In the list that opens, select an element you want to navigate to:

    Show diagram elements

Show implementations

  1. Select a type on the diagram.

  2. Press ⌃ ⌥ B or select Show Implementations from the context menu:

    Show implementations

Jump to source code

  1. Select a diagram element that you want to open in the code editor.

  2. Press F4 or select Selected Element Actions | Jump to Source from the context menu:

Go to source code

Analyze class diagram

To see the list of methods, fields, and other code elements, select the appropriate icon on the diagram toolbar located on top of the diagram editor.

Diagram editor

The lists are displayed based on the selected visibility level, which you can change.

Visibility level

To save the diagram as a file, right-click the diagram editor and from the context menu, select Export Diagram | Export to File and then the file extension in which you want to save the diagram.

Manage class diagram

When working with diagrams, use the context menu in the diagram editor to perform different tasks. You can view members of a type, delete types, see implementations, check parent types, and so on.

Select elements in a diagram

  • To select an element, click it in diagram.

  • To select multiple adjacent elements, keep Shift pressed and click the desired elements, or just drag a lasso around the elements to be selected.

  • To select multiple non-adjacent elements, keep Ctrl+Shift pressed and click the desired elements.

  • To select a class member, double-click the class element, and then use the arrow keys, or the mouse pointer.

Delete a node element from the diagram

  1. In the diagram editor, select a node element you want to delete.

  2. Right-click the element and from the context menu, select Delete .

Configure diagram settings

You can configure the diagram settings so that you have certain options available by default when you create a diagram.

  1. Click the Settings icon on the toolbar.

  2. In the right-hand pane, select the options that you want to see by default and click OK to apply your changes.

Analyze graph

The Analyze Graph action group lets you analyze the graph in various ways such as perform auto clusterization, measure the node centrality, search cycles, filter path between two nodes, and so on.

Filter paths between two nodes

Most of the time, generated diagrams are big and complicated. Typically, you want to concentrate only on the specific part of the diagram. AppCode lets you filter paths between two diagram elements.

  1. In the diagram editor, select two nodes on which you want to focus and right-click one of them to open the context menu.

  2. From the context menu, select Analyze Graph | Focus on Paths between Two Nodes.

  3. In the dialog that opens, select additional options if needed and click Find.

    the Focus on Paths between Two Nodes dialog

    AppCode displays connections associated only with the selected nodes.

    Paths between nodes

Measure diagram centrality

You can use this action to identify the important nodes in the graph.

  1. In the diagram editor, right-click anywhere in the editor to open the context menu.

  2. From the context menu, select Analyze Graph | Measure Centrality.

  3. In the dialog that opens, select additional options if needed and click Measure.

    Measure Centrality

    The node "importance" is expressed via fractional value from 0.0 to 1.0 measurement and the brightest node selection should be explored first.

    Measure Nodes

Productivity tips

Enable the diagram preview

Open the Structure tool window ⌥ 7 and drag the shadow area to obtain the desired view. Select one or more nodes in the diagram to highlight the corresponding nodes in the preview area.

Manage diagram layout

Right-click the diagram background, and choose Layout from the context menu. Then select the desired layout from the submenu. To apply the selected layout, click the Apply Current Layout button on the diagram toolbar.

Alternatively, drag entities in the diagram manually to achieve the desired layout.

Zoom in and out

Use any of the following techniques:

  • Click the Zoom In button and the Zoom Out button on the diagram editor toolbar.

  • Keeping Ctrl pressed, rotate your mouse wheel.

  • Press NumPad+ or NumPad-.

Use the magnifier tool

Keeping Alt pressed, hover your mouse pointer over diagram areas.

Last modified: 03 August 2022