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

前端 未结 2 916
遥遥无期
遥遥无期 2020-12-10 03:43

I use #pragma mark - Description frequently to organize my methods in Xcode. However, I find that sometimes I need to categories and subcategories for my method

2条回答
  •  生来不讨喜
    2020-12-10 04:48

    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{}
    

    enter image description here

提交回复
热议问题