Xcode: the best character navigator for the current class

Is there a plugin or some other way for Xcode 5 to make the character navigator more useful , just by showing the current class and making #pragma marks as if we were clicking on the transition bar?

The fact is that we do not need to press the transition panel, the navigator is always displayed as a tab in the right panel.

In my opinion, the default navigator in the left pane is weak.

See attached image.

EDIT: I created the plugin itself. You can download it at: https://github.com/zolomatok/ZMDocItemInspector

If you are interested in writing your own plugins, here is a detailed tutorial to help you: https://github.com/zolomatok/Creating-an-Xcode-plugin

enter image description here

+7
symbols plugins xcode xcode5
source share
1 answer

Not what I know, but a few methods that can make your life easier:

  • Press control + 6 to quickly open these document elements (list of method names and pragma).

  • By the way, when this happens, many people do not know that you can just start typing, and it will also search this pop-up menu, cutting out elements that do not match what you entered.

  • You might want to use the character navigator, which you can pull out by pressing command + 2 or by clicking the second tab on the navigation bar:

    enter image description here

  • Another great tool is Quick Open ( shift + command + O (which is the letter “oh”)).

  • Code folding is also a way to quickly collapse your code so you can quickly jump to a specific procedure. You can press shift + option + command + left arrow to quickly collapse all your code, scroll to the desired one, and then expand (either all or just this procedure).

  • A bit more complicated, but you can use a documentation system. I am using appledoc . You can put comments in your code corresponding to HeaderDoc or Doxygen . Therefore, consider the following method declaration:

    /** Initialize `Download` operation, downloading from `url`, saving the file to `path`. * * The operation starts when this operation is added to an operation queue. * * @param url The remote URL of the file being downloaded. * * @param path The local filename of the file being downloaded. This should be the full path of the file (both the path and filename) and should be in a directory that the user has permission. * * If this `nil`, the filename will be taken from the `lastPathComponent` of the URL, and will be stored in the `Documents` folder. * * @return Download operation * * @see initWithURL: */ - (id)initWithURL:(NSURL *)url path:(NSString *)path; 

    The structure of this commentary: (a) starts with /** , not just /* ; and (b) provide descriptions of @param and @return . When you do this, you can submit your code to one of these documentation mechanisms, and you will get a good set of documentation. It also includes a class hierarchy.

    But, although we all know that we should document our code, in Xcode 5 we have a more compelling reason, as our comments are automatically integrated into the main Xcode help system in real time. By inserting these comments into your code, Xcode 5 now automatically shows you the documentation for your methods in the quick help window, as well as for Cocoa classes.

    In response to your question about the ability to see the entire class hierarchy using appledoc , you can create and install a "docset" that you can show in the Xcode documentation browser (in Organizer in Xcode 4.x, in a separate Documentation window in Xcode 5), by going to the project folder by executing the following command on the terminal command line:

    appledoc --project-name MyApp --install-docset --output ../ MyAppDocumentation.

    In addition to creating a docset that you can view in Xcode, these documentation systems allow you to create documentation that you can provide to third parties (if you ever need to do this). Appledoc, in particular, is creating an Apple site similar to HTML documentation. For example, here is the documentation for the above method declaration.

    This separate “command line docset build” is not as smooth as the “add” you expect, but I find that with the integrated analysis of the Xcode 5 documentation, I personally integrated the documentation of my code in my development process. (I'm embarrassed to say that this was one of those things that I put off until the end of the development process.)

For additional methods to optimize interaction with Xcode, see WWDC 2012 Video Effectively with Xcode or WWDC 2013 Video Xcode Core Concepts.

+16
source share

All Articles