Программно, чтобы iPhone вибрировал [дублировать
-
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:
- click the project from Project Navigator
- click the target from the left-hand navigator
- click Build Phases section at the top
- expand the Link Binary With Libraries section
- click little + (plus) sign
- type
AudioToolbox.framework
- click Add
Не связан с StackOverflow