Can't link Obj-C Enum Symbol with DocC

Hi all,

I am trying to use this guide to link directly to symbols in my documentation. But I am unable to get it to link to an Objective-C enum case. For example

``EnumNameType/EnumNameMyCase`` 

does not create a link. It works fine for method names, etc. I have tried all of the combinations I can think of, but I can't get it to work.

Any help is much appreciated!

Is this an Objective-C project? Or a Swift project where you’ve bridged over this Objective-C bit?

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

This is a Swift Project with bridged Objective-C code. The documentation in question is in a Swift file /// styled like this

This is working for me. In Xcode 16.0 I created a Swift project from the macOS > App template and added an Objective-C class to it. I included the class header in the bridging header. I then added this to the class header.

/// Identifies the reflectiveness of a waffle.

typedef NS_ENUM(NSUInteger, WaffleVarnisherFinish) {
    /// This waffle is very reflective.
    WaffleVarnisherFinishGloss,
    /// This waffle is moderately reflective.
    WaffleVarnisherFinishSatin,
    /// This waffle is not reflective.
    WaffleVarnisherFinishMatt,
};

In Swift I did this:

let finish: WaffleVarnisherFinish = .gloss

Option-clicking on WaffleVarnisherFinish and .gloss showed the doc comment in Quick Help, which is a good first step.

I then added this to my Swift code:

extension WaffleVarnisherFinish {
    
    /// Returns the inverse of the finish.
    ///
    /// For example, if the finish is ``gloss`` it returns ``matt``.

    var inverse: Self {
        switch self {
        case .gloss: .matt
        case .satin: .satin
        case .matt: .gloss
        @unknown default: self
        }
    }
}

I did a Product > Build Documentation and, in the documentation for the inverse property, the links to gloss and matt were ‘live’.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Can't link Obj-C Enum Symbol with DocC
 
 
Q