Contents

TN3108: Viewing the interface of your Swift code

Learn how to navigate to the interface file of a Swift implementation file.

Overview

Xcode generates an interface file that includes all your source code’s internal and public declarations when using the Assistant editor, the Related Items, or the Navigate menu.

Using the assistant editor

  1. In the project navigator, select your implementation file.

  2. Choose Editor > Assistant.

The generated interface for your Swift code appears in the assistant editor on the right. [Image]

  1. In the project navigator, select your implementation file.

  2. Click the Related Items icon in the editor’s jump bar.

  3. In the menu that appears, choose Counterparts > [Filename] to view your interface file. [Image]

Alternatively, choose Generated Interface > [Filename] from the menu.

To navigate back to your implementation file, choose Original Source from the menu. [Image]

Using the Navigate menu

In the project navigator, select your implementation file, then choose Navigate > Jump to Next Counterpart to view the interface file. [Image]

To navigate back to your implementation file, choose Navigate > Jump to Previous Counterpart or Navigate > Jump to Original Source [Filename]. [Image]

Revision History

  • 2022-05-24 Made minor editorial changes.

  • 2022-02-08 Republished as TN3108 with significant editorial changes.

  • 2016-03-23 First published as QA1914.

See Also

Latest