Nieb_Hasan_077
Nieb_Hasan_077

Reputation: 71

Mixed Language documentation generation in Xcode Framework

I have created a sample objective c framework in Xcode where I also created a swift file. This is the navigation controller showing one swift file and another objective c class (NewFramework).

When I try to build documentation for the framework, I will only get documentation for the swift file and not for the objective c class. Here is the ObjcTemp.h file contents:

#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN

@interface ObjcTemp : NSObject

@property int val;

-(void)printHello;

@end

NS_ASSUME_NONNULL_END

And here is the ObjcTemp.m file contents:

#import "ObjcTemp.h"

@implementation ObjcTemp

-(void)printHello{
    printf("Hello World!");
}

@end

I used default xcode 13 documentation tool (DocC). Build Documentation

The resulting generated documentation archive is like below: . enter image description here

I want to generate complete documentation both for objective c and swift files using Default Xcode documentation tool. How can I do that ?

Upvotes: 0

Views: 172

Answers (1)

David R&#246;nnqvist
David R&#246;nnqvist

Reputation: 56625

DocC in Xcode 13 is only able to build documentation for Swift code.

Support for building documentation for Objective-C code was added in Xcode 14:

Documentation

New Features

  • Swift-DocC in Xcode now supports writing and building documentation for Objective-C and C APIs

Upvotes: 1

Related Questions