"Header" Assistant Editor View for Swift

Originator:tschmitz
Number:rdar://18256954 Date Originated:09/06/2014
Status:Open Resolved:
Product:Developer Tools Product Version:6.0
Classification:Enhancement Reproducible:N/A
 
It would be wonderful if Xcode provided an automatically generated "header" view for Swift files in the Assistant Editor. This view would allow developers to see the public (and maybe internal?) properties and methods of a class while omitting private members and the implementation details. Developers would get all the benefits of headers without actually having to write them.

For example, a header view for a Swift class called Message might look something like this:

class Message : NSObject {
  public var messageID: String
  public var text: String
  public var date: NSDate
  public var read: Bool
  public var deleted: Bool
  
  init()
  
  public class func fetchAllMessagesFromServer()
  
  public func replyWithText(text: String)
}

This idea is adapted from a blog post: http://minutestomidnight.net/blog/2014/9/automatic-headers-in-swift

Comments

Sweet, it now appears this feature is in the latest version of XCode. I noticed it and was kind of like, what the heck? Because my project is an objective C project. I accidentally ended up looking at a swift header... it freaked me out because I haven't written a single line of Swift for this project. Then I googled this and found your blog post about suggesting this feature, which linked here. Well, looks like Apple listened to you :D

In my project it appears not only under Generated Interface, but also, under Counterparts.

This is already implemented (or, maybe, this is now implemented?)

Open the assistant editor, click on the top bar where it most usually says 'Manual' and select 'Swift Interface Summary'. As of Xcode 7, instead select 'Generated Interface'.

By tomh.retrospec at June 30, 2015, 5:43 p.m. (reply...)

I agree, this would be a nice feature in Xcode.

By fs.dolphin at Feb. 5, 2015, 1:40 p.m. (reply...)

Excellent idea, hope it will be available as soon as possible.


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!