How to Embed Quick Sources Code Document with Xcode 6

I use the ability of Xcode 5 to document my code using the syntax of supported comments ( see this SO question ). Xcode 6 supports it with Objective-C sources, unfortunately not with Swift sources.

I would like to do inline documentation on the .swift source. Any idea how to do this or best practices?

Thanks in advance,

Louis

+4
source share
2 answers

It looks like you can add function descriptions:

/**
This is a description of my function
*/
func myFunc() {

}
///this is a description of my second function
func myFunc2(){

}

but none of the headerdoc tags are currently supported. This will probably be supported by the time Xcode 6 is released.

+2

, Xcode 6. , , :

class Foo {

    /// This method does things.
    /// Here are the steps you should follow to use this method
    ///
    /// 1. Prepare your thing
    /// 2. Tell all your friends about the thing.
    /// 3. Call this method to do the thing.
    ///
    /// Here are some bullet points to remember
    ///
    /// * Do it right
    /// * Do it now
    /// * Don't run with scissors (unless it tuesday)
    ///
    /// :param: name The name of the thing you want to do
    /// :returns: a message telling you we did the thing
    func doThing(name : String) -> String {
        return "Did the \(name) thing";
    }
}

Quick Help, , , , .

- , .

+8

Source: https://habr.com/ru/post/1546466/


All Articles