Gallery
Contents
Gallery 은 사진첩을 불러오는 기능을 제공한다.
확장 프레임워크 파일을 추가하여 사용할 수 있으며 추가 방법은 iOS 개발 가이드 의 내용을 참조한다.
open
갤러리 화면 열기 기능이며 호출 방법은 다음과 같다.
Params
파라매터 | 설명 | 비고 |
---|---|---|
type | 0: 이미지 1: 비디오 | |
maxCount | 선택할 수 있는 최대 개수 (최대/기본 값 : 9) | type이 0(이미지)인 경우만 유효하며 1(비디오)인 경우 maxCount 값 상관없이 1개로 설정 |
Example
///////////////
// 3.10.18 이상
///////////////
let deviceAPI = DAPGallery()
let infoParam = DAPGalleryOpenParam()
infoParam.type = NSNumber(value: 0)
infoParam.maxCount = NSNumber(value: 3)
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 = DAPGallery()
let params = [0, 3]
deviceAPI.execute(withActionName: "open", 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 = DAPGallery()
let infoParam = DAPGalleryOpenParam()
infoParam.type = NSNumber(value: 0)
infoParam.maxCount = NSNumber(value: 3)
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 = DAPGallery()
let params = [0, 3]
deviceAPI.execute(withActionName: "open", 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 = [DAPGallery new];
DAPGalleryOpenParam *infoParam = [DAPGalleryOpenParam new];
infoParam.type = [NSNumber numberWithInteger:HMPImagePickerMediaTypeImage];
infoParam.maxCount = [NSNumber numberWithInteger:3];
[deviceAPI executeWithParam:infoParam completion:^(NSDictionary *resultDict) {
NSObject *resultObject = [resultDict objectForKey:kDeviceResult];
ResultData *resultData = [ResultData resultDataWithType:@"imageResultDlg" resultObject:resultObject];
[self showSuccessDlgWithResultData:resultData];
} failure:^(NSError *error) {
[self showErrorDlgWithError:error];
}];
///////////////
// 3.10.18 이하
///////////////
DAPDeviceAPI *deviceAPI = [DAPGallery new];
NSArray *params = [NSArray arrayWithObjects:[NSNumber numberWithInt:0], [NSNumber numberWithInt:3], nil];
[deviceAPI executeWithActionName:@"open" params:params completion:^(NSDictionary *resultDict) {
} failure:^(NSError *error) {
}];
// 3.10.18 이상
///////////////
DAPDeviceAPI *deviceAPI = [DAPGallery new];
DAPGalleryOpenParam *infoParam = [DAPGalleryOpenParam new];
infoParam.type = [NSNumber numberWithInteger:HMPImagePickerMediaTypeImage];
infoParam.maxCount = [NSNumber numberWithInteger:3];
[deviceAPI executeWithParam:infoParam completion:^(NSDictionary *resultDict) {
NSObject *resultObject = [resultDict objectForKey:kDeviceResult];
ResultData *resultData = [ResultData resultDataWithType:@"imageResultDlg" resultObject:resultObject];
[self showSuccessDlgWithResultData:resultData];
} failure:^(NSError *error) {
[self showErrorDlgWithError:error];
}];
///////////////
// 3.10.18 이하
///////////////
DAPDeviceAPI *deviceAPI = [DAPGallery new];
NSArray *params = [NSArray arrayWithObjects:[NSNumber numberWithInt:0], [NSNumber numberWithInt:3], nil];
[deviceAPI executeWithActionName:@"open" params:params completion:^(NSDictionary *resultDict) {
} failure:^(NSError *error) {
}];