xcode 快捷
Knowing the Xcode shortcuts would improve your speed and boost your productivity. Today, we will be discussing some of the commonly used shortcuts.
了解Xcode快捷方式将提高您的速度并提高生产力。 今天,我们将讨论一些常用的快捷方式。
- ⌘ – Command ⌘–命令
- ⇧ – Shift ⇧–移位
- ⌥ – Option/Alt ⌥–选项/替代
- ⌃ – Control ⌃ –控制
- ⇠⇢ – Left/Right Arrow Keys ⇠⇢–左/右箭头键
- ⇡⇣ – Up/Down Arrow Keys ⇡⇣–向上/向下箭头键
- ⏎ – Return ⏎–返回
- ⇥ – Tab ⇥– Tab
- ⎋ – Escape ⎋–逃生
基本捷径 (Basic Shortcuts)
Here’s a list of a few basic shortcuts that we all need to know:
这是我们都需要知道的一些基本快捷方式的列表:
- Build: ⌘B 内部版本: ⌘B
- Run: ⌘R 运行: ⌘R
- Test: ⌘U 测试: ⌘U
- Stop: ⌘. 停止: ⌘。
⌘ + K is used to do a basic clean
⇧ + ⌘ + K is used to do a complete clean of all build files. This is used when your environment starts to behave weirdly
K + K用于基本清洁
⇧+⌘+ K用于完全清除所有构建文件。 当您的环境开始出现异常行为时使用
Let’s next look at some Workspace Shortcuts:
接下来让我们看一些工作区快捷方式:
工作区快捷方式 (Workspace Shortcuts)
Hide/Show Navigation Area :⌘ + 0
隐藏/显示导航区域:⌘+ 0

Xcode Workspace Shortcut Navigation
Xcode工作区快捷方式导航
Hide/Show Debugging Area : ⌘+⇧+Y
隐藏/显示调试区域:⌘+⇧+ Y

Xcode Workspace Shortcut Debugging Area
Xcode工作区快捷方式调试区域
Hide/Show Utility Area : ⌘+⌥+ 0
隐藏/显示实用区域:⌘+⌥+ 0

Xcode Workspace Shortcut Utility
Xcode Workspace快捷方式实用程序
Navigation through Inspector Area Tabs: ⌘1…8
浏览“检查员区域”选项卡:⌘1…8

Xcode Inspector Tabs Shortcut
Xcode检查器选项卡快捷方式
Navigation through Utilities Area Tabs: ⌘1…6
在实用程序区域选项卡中导航:⌘1…6

Xcode Utilities Tabs Shortcut
Xcode实用程序选项卡快捷方式
快速打开:⇧+⌘+ O (Open quickly: ⇧+⌘+O)

Xcode Shortcut Open Quickly
Xcode快捷方式快速打开
协助编辑 (Assistance Editor)
This can be accessed using the two circles at the top right.
可以使用右上角的两个圆圈进行访问。
Commands to show and hide are:
显示和隐藏的命令是:
Show – ⌘ +⌥ + ⏎
Hide – ⌘ + ⏎
显示–⌘+⌥+⏎
隐藏–⌘+⏎
自动文档:⌘+⌥+ / (Auto-documentation : ⌘ +⌥ + /)
We can add comments over a method in documentation formatting as shown below:
我们可以在文档格式中为方法添加注释,如下所示:

Xcode Shortcut Auto Documentation
Xcode快捷方式自动文档
To comment or uncomment use : ⌘ + /
要发表评论或取消评论,请使用: ⌘+ /
在文件中搜索:⌃ + 6 (Search within a file: ⌃+6)

Xcode Shortcut Search In File
Xcode快捷方式在文件中搜索
编辑/重命名范围:⌃ +⌘+ E (Edit/Rename all in Scope : ⌃+⌘+E)
This shortcut is used to change a variable/method name in the file.
此快捷方式用于更改文件中的变量/方法名称。
修正所有错误:^ +⌥+⌘+ F (Fix all errors : ^+⌥+⌘+F)
Instead of manually fixing each error from the right side error labels, the above command fixes all errors that can be resolved automatically.
上面的命令不是修复右侧错误标签中的每个错误,而是修复了所有可以自动解决的错误。
隐藏/扩展类或方法主体:⌥+⌘+⇢或⌥+⌘+⇠ (Hide/Expand class or method body : ⌥+⌘+⇢ OR ⌥+⌘+⇠)

Xcode Shortcut Hide Expand Function
Xcode快捷键隐藏扩展功能
重新排序语句:⌥+⌘+ [] (Reorder statements : ⌥+⌘ + [ ])
Use command and option along with the right and left brackets to move the statement above/below the adjacent statements.
使用命令和选项以及左右括号将语句移动到相邻语句的上方/下方。

Xcode Shortcut Reorder Statements
Xcode快捷方式重新排序语句
缩进码:⌘+ [] (Indent Code : ⌘ + [ ])
This shortcut is used to indent the whole code left/right
此快捷方式用于向左/向右缩进整个代码

Xcode Shortcut Indent Statements
Xcode快捷方式缩进语句
调试快捷方式 (Debugging Shortcuts)
Add and Remove breakpoints : ⌘ + \
添加和删除断点:⌘+ \

Xcode Shortcut Add Remove Breakpoint
Xcode快捷方式添加删除断点
To enable/disable all breakpoints use ⌘ + Y
要启用/禁用所有断点,请使用⌘+ Y
That’s a wrap on this tutorial demonstrating Xcode Shortcuts. Stay tuned for updates!
这是演示Xcode快捷方式的本教程的总结。 请继续关注更新!
翻译自: https://www.journaldev.com/28616/xcode-shortcuts-you-must-know
xcode 快捷