Is it possible to have a “#pragma mark” hierarchy?

给你一囗甜甜゛ 提交于 2019-11-28 09:55:05

Simply only use the - before and after your main section to surround it in lines, exclude the dash for the subsections, and then the method names will show as always.

#pragma mark - Public Methods -
#pragma mark Helper Methods
- (void)aMethod{}
#pragma mark Other Type of Methods
- (void)anotherMethod{}

#pragma mark - Private Methods -
#pragma mark Some Type of Method
- (void)aPrivateMethod{}

akshay1188

You can use any of these combinations:

  1. Hyphen before Description - Puts a separator above the description

#pragma mark - Description

  1. Hyphen after Description - Puts a separator below the description

#pragma mark Description -

  1. Hyphen before and after Description - Puts a separator above and below the description

#pragma mark - Description -

Also, if you just want separators and no descriptions, simply use #pragma mark or #pragma mark -.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!