Clipboard
Clipboard 은 텍스트 문구를 복사 하거나 불러오는 기능을 제공한다.
확장 프레임워크 파일을 추가하여 사용할 수 있으며 추가 방법은 iOS 개발 가이드 의 내용을 참조한다.
get
클립보드 값 얻어오는 기능이며 호출 방법은 다음과 같다.
Example
///////////////
// 3.10.18 이상
///////////////
let deviceAPI = DAPClipboard()
let infoParam = DAPClipboardGetParam()
deviceAPI.execute(with: infoParam, completion: { (dict) in
guard let resultDict = dict as NSDictionary? else {
return
}
}, failure: { (resultError) in
guard let error = resultError else {
return
}
})
///////////////
// 3.10.18 이하
///////////////
let deviceAPI = DAPClipboard()
let params = [Any]()
deviceAPI.execute(withActionName: "get", params: params, completion: { (dict) in
guard let resultDict = dict as NSDictionary? else {
return
}
}, failure: { (resultError) in
guard let error = resultError else {
return
}
})
// 3.10.18 이상
///////////////
let deviceAPI = DAPClipboard()
let infoParam = DAPClipboardGetParam()
deviceAPI.execute(with: infoParam, completion: { (dict) in
guard let resultDict = dict as NSDictionary? else {
return
}
}, failure: { (resultError) in
guard let error = resultError else {
return
}
})
///////////////
// 3.10.18 이하
///////////////
let deviceAPI = DAPClipboard()
let params = [Any]()
deviceAPI.execute(withActionName: "get", params: params, completion: { (dict) in
guard let resultDict = dict as NSDictionary? else {
return
}
}, failure: { (resultError) in
guard let error = resultError else {
return
}
})
///////////////
// 3.10.18 이상
///////////////
DAPDeviceAPI *deviceAPI = [DAPClipboard new];
DAPClipboardGetParam *infoParam = [DAPClipboardGetParam new];
[deviceAPI executeWithParam:infoParam completion:^(NSDictionary *resultDict) {
ResultData *resultData = [ResultData resultDataWithType:@"textResultDlg" resultObject:[resultDict objectForKey:kDeviceResult]];
[self showSuccessDlgWithResultData:resultData];
} failure:^(NSError *error) {
[self showErrorDlgWithError:error];
}];
///////////////
// 3.10.18 이하
///////////////
DAPDeviceAPI *deviceAPI = [DAPClipboard new];
[deviceAPI executeWithActionName:@"get" params:nil completion:^(NSDictionary *resultDict) {
NSString *result = [resultDict objectForKey:kDeviceResult];
NSLog(@"%@", result);
} failure:^(NSError *error) {
}];
// 3.10.18 이상
///////////////
DAPDeviceAPI *deviceAPI = [DAPClipboard new];
DAPClipboardGetParam *infoParam = [DAPClipboardGetParam new];
[deviceAPI executeWithParam:infoParam completion:^(NSDictionary *resultDict) {
ResultData *resultData = [ResultData resultDataWithType:@"textResultDlg" resultObject:[resultDict objectForKey:kDeviceResult]];
[self showSuccessDlgWithResultData:resultData];
} failure:^(NSError *error) {
[self showErrorDlgWithError:error];
}];
///////////////
// 3.10.18 이하
///////////////
DAPDeviceAPI *deviceAPI = [DAPClipboard new];
[deviceAPI executeWithActionName:@"get" params:nil completion:^(NSDictionary *resultDict) {
NSString *result = [resultDict objectForKey:kDeviceResult];
NSLog(@"%@", result);
} failure:^(NSError *error) {
}];
set
클립보드 값 설정하는 기능이며 호출 방법은 다음과 같다.
Example
///////////////
// 3.10.18 이상
///////////////
let deviceAPI = DAPClipboard()
let infoParam = DAPClipboardSetParam()
infoParam.data = text
deviceAPI.execute(with: infoParam, completion: { (dict) in
}, failure: { (resultError) in
guard let error = resultError else {
return
}
})
///////////////
// 3.10.18 이하
///////////////
let deviceAPI = DAPClipboard()
let params = [text as Any]
deviceAPI.execute(withActionName: "set", params: params, completion: { (dict) in
}, failure: { (resultError) in
guard let error = resultError else {
return
}
})
// 3.10.18 이상
///////////////
let deviceAPI = DAPClipboard()
let infoParam = DAPClipboardSetParam()
infoParam.data = text
deviceAPI.execute(with: infoParam, completion: { (dict) in
}, failure: { (resultError) in
guard let error = resultError else {
return
}
})
///////////////
// 3.10.18 이하
///////////////
let deviceAPI = DAPClipboard()
let params = [text as Any]
deviceAPI.execute(withActionName: "set", params: params, completion: { (dict) in
}, failure: { (resultError) in
guard let error = resultError else {
return
}
})
///////////////
// 3.10.18 이상
///////////////
DAPDeviceAPI *deviceAPI = [DAPClipboard new];
DAPClipboardSetParam *infoParam = [DAPClipboardSetParam new];
infoParam.data = text;
[deviceAPI executeWithParam:infoParam completion:^(NSDictionary *resultDict) {
ResultData *resultData = [ResultData resultDataWithType:@"textResultDlg" resultObject:NSLocalizedString(@"app_result_saved", nil)];
[self showSuccessDlgWithResultData:resultData];
} failure:^(NSError *error) {
[self showErrorDlgWithError:error];
}];
///////////////
// 3.10.18 이하
///////////////
DAPDeviceAPI *deviceAPI = [DAPClipboard new];
NSArray *params = [NSArray arrayWithObjects:@"test", nil];
[deviceAPI executeWithActionName:@"set" params:params completion:^(NSDictionary *resultDict) {
NSString *result = [resultDict objectForKey:kDeviceResult];
NSLog(@"%@", result);
} failure:^(NSError *error) {
}];
// 3.10.18 이상
///////////////
DAPDeviceAPI *deviceAPI = [DAPClipboard new];
DAPClipboardSetParam *infoParam = [DAPClipboardSetParam new];
infoParam.data = text;
[deviceAPI executeWithParam:infoParam completion:^(NSDictionary *resultDict) {
ResultData *resultData = [ResultData resultDataWithType:@"textResultDlg" resultObject:NSLocalizedString(@"app_result_saved", nil)];
[self showSuccessDlgWithResultData:resultData];
} failure:^(NSError *error) {
[self showErrorDlgWithError:error];
}];
///////////////
// 3.10.18 이하
///////////////
DAPDeviceAPI *deviceAPI = [DAPClipboard new];
NSArray *params = [NSArray arrayWithObjects:@"test", nil];
[deviceAPI executeWithActionName:@"set" params:params completion:^(NSDictionary *resultDict) {
NSString *result = [resultDict objectForKey:kDeviceResult];
NSLog(@"%@", result);
} failure:^(NSError *error) {
}];