Store feedback generator

This commit is contained in:
Ali 2020-01-04 23:59:14 +04:00
parent 16517e377c
commit ca49de1830

View File

@ -136,6 +136,8 @@ typedef enum
bool _canSendSilently; bool _canSendSilently;
bool _canSchedule; bool _canSchedule;
bool _reminder; bool _reminder;
UIImpactFeedbackGenerator *_generator;
} }
@property (nonatomic, copy) bool(^isAlreadyLocked)(void); @property (nonatomic, copy) bool(^isAlreadyLocked)(void);
@ -707,8 +709,10 @@ typedef enum
- (void)sendLongPressed { - (void)sendLongPressed {
if (iosMajorVersion() >= 10) { if (iosMajorVersion() >= 10) {
UIImpactFeedbackGenerator *generator = [[UIImpactFeedbackGenerator alloc] initWithStyle:UIImpactFeedbackStyleMedium]; if (_generator == nil) {
[generator impactOccurred]; _generator = [[UIImpactFeedbackGenerator alloc] initWithStyle:UIImpactFeedbackStyleMedium];
}
[_generator impactOccurred];
} }
bool effectiveHasSchedule = true; bool effectiveHasSchedule = true;