Objective-C and Swift Documentation together like Apple documentation [closed]
Asked Answered
C

1

7

I am currently working on building iOS SDK, written in Objective-C. Now that I have SDK tested and ready, would wanted to add Documentation to it combining Swift and Objective-C. I have worked on following Doc generator tools

a. Doxygen

b. AppleDoc

c. Jazzy

d. Apple’s HeaderDoc.

I would like to use the comments in my objective-c header file and generate combined help for Objective C and Swift similar to how Apple has been doing recently. My question is how do I generate the documentation for Swift and Objective-C from Objective-C headers?

Here are some links based on my research:

Thank you,

Ram.

Please refer the apple documentation here:

image

Conspecific answered 2/12, 2015 at 11:38 Comment(6)
It is unclear what you are asking. You want to build an App using both Obj-c and swift? What is that bit about documentation then? Why do you even mean by "supporting both obj-c and swift"? the target is iOS. It supports both. That's the whole thing there isQuesada
If you want to use obj-c files in a swift project then you should read this. developer.apple.com/library/ios/documentation/Swift/Conceptual/… . It is possibleQuesada
Thank you for the Quick reply. I want to generate doc sets like how apple documents it's APIs which includes documentation for both Swift and Objective-C. Please refer hereConspecific
@Quesada Made the question more clear.Conspecific
Ram is right - this would be very interesting in auto-generated docs for example for Objective-C libs hosted in CocoaPods. For local Docs it is also very intersting. For some years we will have Objective-c and swift hybrids that will benefit from such combined docs.Abirritant
The question is very clear. he want to generate documentation (create a docset) using some tools that will format the docset the same way apple does. in which the code for both swift and OBJ-C is represented in the official apple doc. where you can get the documentation for both swift and or obj-c. I have looked for the same type of tool, as my project is a hybrid project and use 2 different tools do generate the docset for the obj-c part and then an other for the swift part, and ending up with 2 docset is a pain. sadly I have not seen a tool that does just this. wondering how apple does it??Bowsprit
E
2

Maybe not (yet) exactly what you are looking for, but you can use Swiftify (https://objectivec2swift.com/) service to convert declarations from Objective-C to Swift.

Furthermore, if above documentation tools allow to develop any sort of a plugin to integrate with, it should be possible to automatically generate Swift sources using our Web API.

We may be willing to develop such an integration if there will be a demand for it.

Disclaimer: I am the author of Swiftify :)

Erasme answered 3/12, 2015 at 10:40 Comment(1)
Thank you for valuable reply. I tried Swiftify. It converts Objective-C code to Swift perfectly but not documentation of the code. However, as you mentioned if there will be a demand, count me +1 as a eager to wait for the feature.Conspecific

© 2022 - 2024 — McMap. All rights reserved.