#import 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]; }