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

Zakaria Acharki
  • 66,747
  • 15
  • 75
  • 101
Ram
  • 81
  • 5
  • 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 is – NSNoob Dec 02 '15 at 11:41
  • 1
    If you want to use obj-c files in a swift project then you should read this. https://developer.apple.com/library/ios/documentation/Swift/Conceptual/BuildingCocoaApps/MixandMatch.html . It is possible – NSNoob Dec 02 '15 at 11:42
  • 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 [here](https://developer.apple.com/library/mac/documentation/Cocoa/Reference/Foundation/Classes/NSArray_Class/#//apple_ref/occ/instm/NSArray/componentsJoinedByString:) – Ram Dec 02 '15 at 11:47
  • @NSNoob Made the question more clear. – Ram Dec 02 '15 at 16:20
  • 2
    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. – ThorstenC Mar 02 '16 at 09:14
  • 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?? – Pascale Beaulac Aug 17 '17 at 17:25

1 Answers1

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 :)

Crulex
  • 1,030
  • 9
  • 16
  • 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. – Ram Dec 03 '15 at 12:50