Wednesday, February 11, 2015

Alternative of #pragma mark for Swift


In Objective C, you might have used the #pragma mark directive for code organization in Jump bar.
But with Xcode 6 there is no pragma directive. Instead of this, you can use MARK, TODO and FIXME for managing the code which is supported by Xcode 6.

1) MARK:- It is an alternative of #pragma mark directive. It can be used for organizing code in a logical way so that it can be navigated by jump bar.




2) TO DO:- You can use this tag to make reminder to work on this later. You can use this tag within the function or outside the function.




3) FIX ME:- You can use this tag to make a reminder to fix some piece of code or methods. It can be placed inside or outside of the methods.




Note- “-” is optional in all the directives. If you use this dash then it will show a separator line in the Jump bar above the text.

No comments:

Post a Comment