23 lines
661 B
Plaintext
23 lines
661 B
Plaintext
#import <UIKit/UIKit.h>
|
|
|
|
extern "C" void _TriggerHapticFeedback(int force) {
|
|
UIImpactFeedbackStyle style = UIImpactFeedbackStyleMedium;
|
|
switch (force) {
|
|
case 0:
|
|
style = UIImpactFeedbackStyleLight;
|
|
break;
|
|
case 1:
|
|
style = UIImpactFeedbackStyleMedium;
|
|
break;
|
|
case 2:
|
|
style = UIImpactFeedbackStyleHeavy;
|
|
break;
|
|
default:
|
|
style = UIImpactFeedbackStyleMedium;
|
|
break;
|
|
}
|
|
|
|
UIImpactFeedbackGenerator *generator = [[UIImpactFeedbackGenerator alloc] initWithStyle:style];
|
|
[generator prepare];
|
|
[generator impactOccurred];
|
|
} |