Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to view just the public API "header" of a Swift file?

Tags:

xcode

swift

I am now programming in Swift to edit the file/class Chicken.swift and I need to refer to the public api for Food.swift. Because the Chicken wants to eat Food.

So I click on Food.swift so I can RTFM. But instead of just getting the public api part that I am interested in, I get all the private crap and implementation details.

This is inefficient. Back in C/Objective-C/C++, I would just click on the .h file to get only the details I need.

Where does such information now exist for Swift development in XCode?

like image 336
William Entriken Avatar asked Dec 20 '15 08:12

William Entriken


Video Answer


2 Answers

example

How about using counterparts option

like image 115
Warif Akhand Rishi Avatar answered Oct 06 '22 00:10

Warif Akhand Rishi


Shortcut for this is

CMD + CTRL + arrow up

like image 38
Ted Avatar answered Oct 05 '22 23:10

Ted