#pragma mark in Swift?

来源:互联网 发布:金山打字通mac版官网 编辑:程序博客网 时间:2024/06/16 03:11
In Objective C, I can use #pragma mark to mark sections of my code in the symbol navigator. Since this is a C preprocessor command, it's not available in Swift. Is there a stand-in for this in Swift, or do I have to use ugly comments?

#pragma mark in Swift —– // MARK:

Just talked to an Engineer here at WWDC, and the current beta of Xcode doesn't implement thestyle yet, but I'm told future versions will.It was also suggested that making liberal use of class extensions might be a better practice anyway. Since extensions can implement protocols, you can e.g. put all of your table view delegate methods in an extension and group your code at a more semantic level than #pragma mark is capable of.
0 0
原创粉丝点击