What is the significance of #pragma marks? Why do we need #pragma marks?

前端 未结 7 1385
耶瑟儿~
耶瑟儿~ 2021-01-29 17:21

What is the purpose of #pragma marks in Xcode? Does their location in .m files matter? Should some #pragma come before all others?

7条回答
  •  南方客
    南方客 (楼主)
    2021-01-29 17:56

    #pragma mark - NSSecureCoding
    

    The main purpose of "pragma" is for developer reference.

    You can easily find a method/Function in a vast thousands of coding lines.

    Xcode 11+:

    Marker Line in Top

    // MARK: - Properties
    

    Marker Line in Top and Bottom

    // MARK: - Properties - 
    

    Marker Line only in bottom

    // MARK: Properties -
    

提交回复
热议问题