The side bar, next to the code line numbers, that allows expansion/collapsing of brace/brackets {} is no longer showing in Xcode. I am trying to figure out how to get it back.
Xcode expand/collapse braces/brackets {} side bar missing
3.7k views Asked by SAHM At
3
There are 3 answers
3
On
Code folding is working now, in Xcode 9 Beta5 according to beta release note: Resolved in Xcode 9 beta 5 – IDE
Here is how:
- Press and hold ⌘ (command) button in keyboard and move/hover mouse cursor on any (start or end) braces. It will automatically highlight, block area.
- Keep (hold) ⌘ (command) button in pressed condition and click on highlighted area. It will enable quick menu popover window with
Fold
option. - Select
Fold
from menu list. It will fold your code and shows 3 dots, folding/covering entire block. - Now, to again unfold your code block, release ⌘ (command) button and click on 3 dots folding a block.
For easy understanding, look at this snapshot:
It's all keyboard short cuts are also working.
Fold ⌥ ⌘ ← option + command + left arrow
Unfold ⌥ ⌘ → option + command + right arrow
Unfold All ⌥ U option + U
Fold Methods/Functions ⌥ ⌘ ↑ option + command + up arrow
Unfold Methods/Functions ⌥ ⌘ ↓ option + command + down arrow
Here is ref snapshot:
Go to Xcode Preferences/Text Editing and check the "Code Folding Ribbon" box.
EDIT: As of Version 9.0.1 (9A1004), this feature has been removed from Xcode 9. I am looking for a new editor because I use this feature so much, and I cannot believe they actually removed it in Xcode 9.