功能
control + I 代码格式化/自动排版:
(Xcode8 版本:版本
选中需要格式化代码 -> Editor -> Structure ->Re-Indent 或者
选中需要格式化代码 -> 右击 ->选中 Structure ->Re-Indent)
Command + Shift + F 表示:跳转到搜索导航器【非常实用】
Command + Shift + j 表示:显示当前文件,在导航拦中的位置
Command + Shift + option + k 表示:深度clear,清理build folder
Ctrl + 2 表示:显示最近的浏览记录
Command + Ctrl + 2 表示:显示最近的文件历史
Command + 0 表示:显示/隐藏侧边栏
Command + 1 表示:工程导航tab
Command + 2 表示:符号导航tab
Command + 3 表示:搜索tab
Command + ctrl + J 表示:函数定义和实现跳转(一般都用鼠标)
你会发现Command + 数字代表不同的tab
Command+Control+ 上下箭头 表示:切换头文件和源文件
Command + G 表示:在当前文件中查找下一个搜索到的字符
Option+Command+[ 表示:向上移动该行(可多行)
Option+Command+] 表示:向下移动该行
Command + [ 表示:左移代码块
Command + ] 表示:右移代码块
Command + 左箭头/右箭头/ 表示:模拟器横竖屏切换
Command+Control+ 左右箭头 表示:返回下一个和上一个文件
command + . 表示:结束运行
command + , 表示:打开xcode设置
command + ctrl + 左右方向键 表示: 返回刚才的文件
折叠或展开当前类里全部代码
command-alt-shift-left arrow 折叠
command-alt-shift-right arrow 展开
Option + command +左右方向键 折叠或展开单个代码块
Command + shift + y 表示:显示隐藏控制台
Command + T 表示: 创建新的tab
Command + shift + [ 表示: 下一个tab,在xcode中可以打开多个tab页面
Command + shift + ] 表示: 上一个tab
Command + ctrl + J 表示:跳转到变量的定义文件
Command + ctrl + 0 表示:跳转到官方文档
Alt + 鼠标放在模拟器上。 表示:可以模拟多点触摸
Command + shift + o 表示:查找文件
Ctrl+T 表示:交换光标左右两边的字符
Ctrl+D 表示:删除光标右边的字符
Ctrl+K 表示:删除本行
Tab 表示:接受代码提示
Esc 表示:显示代码提示菜单
调试
command + alt + y 到下个断点运行,如果没有下个断点则一直运行
F6单步调试(通常需要按住Fn键)
F7进入函数(通常需要按住Fn键)
F8跳出函数(通常需要按住Fn键)
Command + l(L的小写,不是1) 表示:输入行数,跳转到指定行
其他快捷键
最小化窗体 Command+M
关闭窗体 Command + W
显示桌面fn+F11
截图:苹果+Shift+3 或者 苹果+Shift+4 空格
截图到剪切板:Command+Control+Shift+4
shift-Command-right 选择到行首
shift-Option-左 向左选择一个单词
command-space 切换语言
Option + Left/Right: 将光标移动至一个词(之前/之后)
Commandmand + Left/Right: 将光标移动至行首/行末
欢迎分享更多好用的快捷键
网友评论