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"