Xcode、Mac个人常用快捷键

396 阅读1分钟

Xcode9.1

单行注释: command + /

光标放在某行代码上 按下快捷键; 当然也可以选中多行 注释
如: 
//    self.view.backgroundColor = [UIColor purpleColor];

//- (void)singleTest
//{
//    UIView *testView = [[UIView alloc] init];
//    [self.view addSubview:testView];
//}

为代码块添加描述: option + command + /

选中需要添加描述的代码块或者光标放在代码块头部 按下快捷键

如:
/**
 <#Description#>

 @return <#return value description#>
 */
- (UIView *)test
{
    UIView *testView = [[UIView alloc] init];
    testView.backgroundColor = [UIColor orangeColor];
    return testView;
}
向左移动代码: command + [
向右移动代码: command + ]

一行或多行均可以

向上移动代码: option + command + [
向下移动代码: option + command + ]


Mac

使用外接键盘 不能像使用苹果笔记本一样使用触控板来操作屏幕:

向左切屏: ctrl + <

向右切屏: ctrl + >

展开当前屏幕文件: ctrl + ∧

收起当前屏幕文件: ctrl + ∨