如何折叠Xcode中的所有方法?
如何在 Xcode 中折叠类中的所有方法?
一处崩溃已经不再是一种选择。
How to collapse all methods in a class in Xcode?
Collapsing one by one is not an option anymore.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(7)
从 Xcode 4 开始,它似乎发生了变化。
command-alt-shift-左箭头就可以了...
折叠/展开当前方法或
if
结构使用:折叠:command-alt-左箭头
展开:command -alt-右箭头
As of Xcode 4 it seems to have changed.
command-alt-shift-left arrow will do the trick...
To fold/unfold current methods or
if
structures use:Fold: command-alt-left arrow
Unfold: command-alt-right arrow
Xcode 10 中的更新
Xcode 10 增加了对代码折叠,包括:
看看这个快照:
代码折叠在 Xcode 9 beta 1 中被禁用,根据 beta 发行说明,代码折叠现在在 Xcode 9 Beta5 中可用:已在 Xcode 9 beta 5 – IDE 中解决 操作
方法如下:
Fold
选项的快速菜单弹出窗口。折叠
。它将折叠您的代码并显示 3 个点,折叠/覆盖整个块。为了便于理解,请查看此快照:
It's all keyboard short cuts are also working.
**Code folding options from Xcode Menu**:
> Menubar ▶ Editor ▶ Code Folding ▶ "Here is list of code folding options"
这是参考快照:
< img src="https://i.sstatic.net/78DMm.png" alt="在此处输入图像描述">
Xcode 快捷方式列表中的相同选项:
Updates in Xcode 10
Xcode 10 has increased support for code folding, including:
Look at this snapshot:
Code folding was disabled in Xcode 9 beta 1, which is working now, in Xcode 9 Beta5 according to beta release note: Resolved in Xcode 9 beta 5 – IDE
Here is how:
Fold
option.Fold
from menu list. It will fold your code and shows 3 dots, folding/covering entire block.For easy understanding, look at this snapshot:
It's all keyboard short cuts are also working.
**Code folding options from Xcode Menu**:
> Menubar ▶ Editor ▶ Code Folding ▶ "Here is list of code folding options"
Here is ref snapshot:
Same options from Xcode Short-cut list:
X-Code 7 及以上
要折叠所有方法: Shift + Option + Command + 向左箭头
展开所有方法:Shift + 选项 + 命令 + 向右箭头
X-Code 7 onwards
To collapse all method : Shift + Option + Command + Left arrow
To expand all method : Shift + Option + Command + Right arrow
我喜欢克鲁纳尔的回答(上面)中的这张表:https://stackoverflow.com/a/46020397/1554947
I like this table from Krunal's answer (above) : https://stackoverflow.com/a/46020397/1554947
看起来 Ctrl-Command-Up 可以做到这一点(或在菜单上:Editor-CodeFolding-FoldMethods/Functions)。
Ctrl-Command-向下 或 Ctrl-U 反转。
Looks like Ctrl-Command-Up does it (or on the menu: Editor-CodeFolding-FoldMethods/Functions).
Ctrl-Command-Down or Ctrl-U to reverse.
按 COMMAND + ,“命令逗号”
单击“文本编辑”选项卡
选中“代码折叠功能区”
就在行号右侧,您将看到一个新功能区,函数/方法旁边带有向上或向下箭头。按这些按钮将允许您展开或折叠功能/方法。
Press COMMAND + , "command comma"
Click "Text Editing" tab
Check "Code Folding Ribbon"
Just to the right of line numbers you will see a new ribbon with up or down arrows next to functions / methods. Pressing these will allow you to expand or collapse functions / methods.
Shift + Option + Command + 向左箭头,对我不起作用。
如果使用“查找”并输入“[”,我发现了一个解决方法。
使用“Return”跳至数组。当您找到想要关闭的窗口时,请使用“Option + Command + 向左箭头”。
您可以非常快速地关闭大量数组,而无需单击
Shift + Option + Command + Left arrow, did not work for me.
A work around I have found if use "Find" and put in "[".
use "Return" to skip to arrays. When you come to one you want to close, use the "Option + Command + Left arrow".
you can very quickly close a lot of array without ever clicking