美文网首页
COMMAND + R 监听

COMMAND + R 监听

作者: Bearger | 来源:发表于2017-07-25 09:24 被阅读48次
    #pragma mark 模拟器键盘事件
    - (NSArray *)keyCommands
    {
        
        static NSArray *keyCommands;
        
    #if TARGET_IPHONE_SIMULATOR
        static dispatch_once_t onceToken;
        dispatch_once(&onceToken, ^{
            UIKeyCommand *composeCommand = [UIKeyCommand keyCommandWithInput:@"r"
                                                               modifierFlags:UIKeyModifierCommand
                                                                      action:@selector(composeShortcut:)];
            keyCommands = @[composeCommand];
        });
    #endif
        return keyCommands;
    }
    
    
    - (void)composeShortcut:(UIKeyCommand *)command
    {
        [self reloadAction];
    }
    
    

    相关文章

      网友评论

          本文标题:COMMAND + R 监听

          本文链接:https://www.haomeiwen.com/subject/puxwkxtx.html