Visualizing the public API of Swift types in Xcode

Originator:amber
Number:rdar://18828998 Date Originated:October 30, 2014
Status:Open Resolved:
Product:Developer Tools Product Version:
Classification: Reproducible:
 
Summary:
In Objective-C  it was easy to visualize a public API because  we had headers. In Swift, with access modifiers one can mark member methods and properties as public, internal or private. For the sake of good and complete API design it is helpful to quickly see where you are with a particular public facing API on your objects and other types in your Swift module. Additionally, as a client using an API it is helpful to see this public APIs interface.

I suggest adding access modifier filters to the symbol navigator in Xcode, so one can filter the view to show only public symbols, or what ever combination of access modifiers i'd like to see.

Steps to Reproduce:
Develop and design API in any complex library, set of objects or other types in Xcode using Swift as the language.

Try to visualize what is the public facing API of that library, set of objects or types is.

Note that as the API designer, or client of the APIs. there is no "go to" place to visualize this API.

Expected Results:
A symbol navigator with access modifier filters to see the public, internal, or entire API of my Swift types.

Actual Results:
It's a little uncertain what the full public API is without combing through the source code looking at each public declaration in the source file. What if I don't have the source file?

Version:
Xcode 6.1


UPDATE:  FEB 19
Xcode 6.3 introduces significant improvements with Swift 1.2, the latest revision to our innovative new programming language for Cocoa and Cocoa Touch, working side-by-side with Objective-C.

Please test your issue with the latest Xcode 6.3, and let us know whether you still see the same behavior.  This is a pre-release version of the complete Xcode developer toolset for Mac, iPhone, iPad, and Apple Watch. This release requires OS X Yosemite.

RESPONSE:
In my experience this does not seem to go far enough to promote healthy API design. The tools in Xcode such as the symbol browser could use a way of actually filtering public, private, and internal members, so that you can reason about the encapsulation of your classes. Am I missing a feature that you are referring to? The response was kind of vague.  Yes there were improvements made, but none in this area that I know of.

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!