升级到Xcode7后,会发现代码折叠功能不见了,这是怎么回事?xcode
其实这个功能还在的,只是苹果默认把这个功能禁掉了:在Xcode菜单里选择Preference——Text Editing,你会发现里面有一个“code folding ribbon”,勾选它就能恢复代码折叠功能了。函数
而后经过菜单Editor——Code Folding,你就可使用你须要的折叠功能。spa
相关快捷键:code
局部折叠(折叠一个函数) :Command+Option+Left/Rightget
全局折叠(折叠当前文件下的所有函数):Shift+Command+Option+Left/Rightit
折叠注释块:(/* */之间的文字) : Ctrl+Shift+Command+Left/Rightio
参考:注释
How to bring back Code Folding in Xcode 7 « iOS Dev Diary iOS Dev Diary di