简体   繁体   中英

iOS Xcode Objective-C documenting not in .h file

I'm not asking for a tool as HeaderDoc, Doxygen, appledoc, ....

I'm asking for a way that documenting a method not in .h file.

I MEAN: I don't want to documenting in .h file.

I know we can document that method on .m file at the same method. Too much lines in .h file make the file not easy tracking when some one see the file, so I move docs to .m file.

But there's a case when I need to write document for method in @protocol. It's .h file, has no .m file. And I don't want to document in .h file for easy tracking when some one see the file.

I see iOS sdk has a case for that. As you can inspect built-in @protocol UITableViewDataSource, the documenting is not place in the declaration, it is placed somewhere.

Do you know the way? Thank you.

Documentation can be easily added to any method, property etc. no matter if declared in a header, a protocol or a .m file!

See my example below:

/**
 * Request calendar access.
 * @param access granted block – the block to perform if access has been granted
 */
- (void) requestCalendarAccess:(void (^) (void)) accessGrantedBlock;

More info about easy documentation is available here: http://www.raywenderlich.com/66395/documenting-in-xcode-with-headerdoc-tutorial

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM