diff --git a/CustomKeyboard/View/KBKeyboardView.m b/CustomKeyboard/View/KBKeyboardView.m index b8b3380..c9695f8 100644 --- a/CustomKeyboard/View/KBKeyboardView.m +++ b/CustomKeyboard/View/KBKeyboardView.m @@ -17,7 +17,7 @@ static const NSTimeInterval kKBBackspaceLongPressMinDuration = 0.35; static const NSTimeInterval kKBBackspaceRepeatInterval = 0.06; -static const NSTimeInterval kKBBackspaceChunkStartDelay = 1.0; +static const NSTimeInterval kKBBackspaceChunkStartDelay = 0.1; static const NSTimeInterval kKBBackspaceChunkRepeatInterval = 0.1; static const NSTimeInterval kKBBackspaceChunkFastDelay = 1.4; static const NSInteger kKBBackspaceChunkSize = 6; @@ -926,6 +926,7 @@ edgeSpacerMultiplier:(CGFloat)edgeSpacerMultiplier { if (label.hidden) { label.alpha = 0.0; label.hidden = NO; + [self kb_playLightHaptic]; [UIView animateWithDuration:0.12 animations:^{ label.alpha = 1.0; }]; @@ -987,6 +988,14 @@ edgeSpacerMultiplier:(CGFloat)edgeSpacerMultiplier { return t.accentColor ?: t.keyHighlightBackground ?: [UIColor colorWithWhite:0.8 alpha:1.0]; } +- (void)kb_playLightHaptic { + if (@available(iOS 10.0, *)) { + UIImpactFeedbackGenerator *gen = [[UIImpactFeedbackGenerator alloc] initWithStyle:UIImpactFeedbackStyleLight]; + [gen prepare]; + [gen impactOccurred]; + } +} + - (UILabel *)backspaceClearLabel { if (!_backspaceClearLabel) { UILabel *label = [[UILabel alloc] initWithFrame:CGRectZero];