Программно, чтобы iPhone вибрировал [дублировать

StackOverflow https://stackoverflow.com/questions/2080442

  •  21-09-2019
  •  | 
  •  

Вопрос

Возможный дубликат:
Заставлять iPhone вибрировать

Как вы можете программно заставить iPhone вибрировать?

Любые идеи или учебные ссылки ценится.

Это было полезно?

Решение

You can use

AudioServicesPlaySystemSound(kSystemSoundID_Vibrate); 

Note that you need to add the AudioToolbox framework and import the following header file:

#import <AudioToolbox/AudioServices.h>

Другие советы

To clarify the add(ing) the AudioToolbox framework portion of this answer:

  1. click the project from Project Navigator
  2. click the target from the left-hand navigator
  3. click Build Phases section at the top
  4. expand the Link Binary With Libraries section
  5. click little + (plus) sign
  6. type AudioToolbox.framework
  7. click Add
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top