In the previous version of XCode, there was a little down arrow beside the source code editor for folding or unfolding the code. But in the new version of the XCode (7.2) that little arrow does not exist. It is very annoying to scroll up and down to find out the method which we are searching. On the other hand the code editor looks really messy with unfolded code.
In new XCode there are two ways to code folding or unfolding. First of them is selecting these option from menu bar. Second one is using shortcut key. I prefer the last one. For me it is irritating to use the mouse continually while I am coding.
For the first process put the cursor on the method block which you want to fold or unfold then follow the following steps
XCode menu --> Editor --> Code folding --> then select folding option.
From Image 1 you can see the shortcut keys for all kind of code folding option.
Another little tip, if you are using windows keyboard with your MAC then use
In new XCode there are two ways to code folding or unfolding. First of them is selecting these option from menu bar. Second one is using shortcut key. I prefer the last one. For me it is irritating to use the mouse continually while I am coding.
For the first process put the cursor on the method block which you want to fold or unfold then follow the following steps
XCode menu --> Editor --> Code folding --> then select folding option.
Image 1 : Code folding options from XCode Menu bar. |
From Image 1 you can see the shortcut keys for all kind of code folding option.
- Fold : Option + Command + ←
- Unfold : Option + Command + →
- Fold Methods & Functions : Option + Shift + Command+ ←
- Unfold Methods & Functions : Option + Shift + Command + →
- Fold Comment Blocks : Control + Shift + Command + ←
- Unfold Comment Blocks : Control + Shift + Command + →
Image 2: Comment Block in XCode. |
- Alt instead of Option
- Windows Key instead of Command
- Ctrl instead of Control
No comments:
Post a Comment