Vibrator
Contents
Vibrator 는 디바이스의 진동 기능을 제공한다.
확장 프레임워크 파일을 추가하여 사용할 수 있으며 추가 방법은 iOS 개발 가이드 의 내용을 참조한다.
vibrate
진동을 울리게 하는 기능이며 호출 방법은 다음과 같다.
Example
///////////////
// 3.10.18 이상
///////////////
let deviceAPI = DAPVibrator()
let infoParam = DAPVibratorVibrateParam()
deviceAPI.execute(with: infoParam, completion: { (dict) in
}, failure: { (resultError) in
guard let error = resultError else {
return
}
})
///////////////
// 3.10.18 이하
///////////////
let deviceAPI = DAPVibrator()
let params = [Any]()
deviceAPI.execute(withActionName: "vibrate", params: params, completion: { (dict) in
}, failure: { (resultError) in
guard let error = resultError else {
return
}
})
// 3.10.18 이상
///////////////
let deviceAPI = DAPVibrator()
let infoParam = DAPVibratorVibrateParam()
deviceAPI.execute(with: infoParam, completion: { (dict) in
}, failure: { (resultError) in
guard let error = resultError else {
return
}
})
///////////////
// 3.10.18 이하
///////////////
let deviceAPI = DAPVibrator()
let params = [Any]()
deviceAPI.execute(withActionName: "vibrate", params: params, completion: { (dict) in
}, failure: { (resultError) in
guard let error = resultError else {
return
}
})
///////////////
// 3.10.18 이상
///////////////
DAPDeviceAPI *deviceAPI = [DAPVibrator new];
DAPVibratorVibrateParam *infoParam = [DAPVibratorVibrateParam new];
[deviceAPI executeWithParam:infoParam completion:^(NSDictionary *resultDict) {
} failure:^(NSError *error) {
[self showErrorDlgWithError:error];
}];
///////////////
// 3.10.18 이하
///////////////
DAPDeviceAPI *deviceAPI = [DAPVibrator new];
[deviceAPI executeWithActionName:@"vibrate" params:nil completion:^(NSDictionary *resultDict) {
NSLog(@"%s %d\nresultDict %@", __PRETTY_FUNCTION__, __LINE__, resultDict);
} failure:^(NSError *error) {
NSLog(@"%s %d\nerror %@", __PRETTY_FUNCTION__, __LINE__, error);
}];
// 3.10.18 이상
///////////////
DAPDeviceAPI *deviceAPI = [DAPVibrator new];
DAPVibratorVibrateParam *infoParam = [DAPVibratorVibrateParam new];
[deviceAPI executeWithParam:infoParam completion:^(NSDictionary *resultDict) {
} failure:^(NSError *error) {
[self showErrorDlgWithError:error];
}];
///////////////
// 3.10.18 이하
///////////////
DAPDeviceAPI *deviceAPI = [DAPVibrator new];
[deviceAPI executeWithActionName:@"vibrate" params:nil completion:^(NSDictionary *resultDict) {
NSLog(@"%s %d\nresultDict %@", __PRETTY_FUNCTION__, __LINE__, resultDict);
} failure:^(NSError *error) {
NSLog(@"%s %d\nerror %@", __PRETTY_FUNCTION__, __LINE__, error);
}];