0

I am working on custom keyboard every thing working fine but facing strange issue. i feel that when i press any key of my custom keyboard (if no full access) it fires event with some delay.here is my code

- (void)viewDidLoad 
  {
    [super viewDidLoad];
    [self addGestureTokeybaord];
  }
-(void)addGestureTokeybaord
 {
    [self.keyboard.deletekey addTarget:self action:@selector(pressDeletekey) forControlEvents:UIControlEventTouchUpInside];
    [self.keyboard.spacekey addTarget:self action:@selector(pressSpacekey) forControlEvents:UIControlEventTouchUpInside];
     [self.keyboard.returnkey addTarget:self action:@selector(pressReturnkey) forControlEvents:UIControlEventTouchUpInside];
    [self.keyboard.donekey addTarget:self action:@selector(dismissKeyboard) forControlEvents:UIControlEventTouchUpInside];

    [self.keyboard.globalkey addTarget:self action:@selector(advanceToNextInputMode) forControlEvents:UIControlEventTouchUpInside];




    [self.keyboard.shiftkey addTarget:self action:@selector(unShift) forControlEvents:UIControlEventTouchUpInside];
    [self.keyboard.shiftkeyright addTarget:self action:@selector(unShift) forControlEvents:UIControlEventTouchUpInside];

     [self.keyboard.numberskey addTarget:self action:@selector(pressNumberskey) forControlEvents:UIControlEventTouchUpInside];

    for (UIButton *key in self.keyboard.keysArray) {
        [key addTarget:self action:@selector(pressKey:) forControlEvents:UIControlEventTouchUpInside];
    }
}
-(void)pressKey:(UIButton *)key
{
  [[UIDevice currentDevice] playInputClick];
   [self.textDocumentProxy insertText:[key currentTitle]];
 }

How can i fire my events without any delay (if no full access).? any suggestion will be appreciated. Thanks

jamil
  • 2,419
  • 3
  • 37
  • 64

1 Answers1

0
[[UIDevice currentDevice] playInputClick];

makes your delay. Just wrap it with full access check.

DDS
  • 590
  • 5
  • 9