Window


Window 은 HSP 에서 기본으로 제공하는 API로 별도의 설정 없이 사용 가능하다.
Window 는 HSP 의 화면 단위인 Window 를 제어 하거나 다이얼로그 윈도우를 조정하는 등의 기능을 제공 하며 Window 를 제어하기 위해서는 HMPWindowData 를 전달하여 Window 를 관리할 수 있으며 그 세부내용은 아래의 표를 참고 한다. 

HMPWindowData Class

@interface HMPWindowData : NSObject

@property (nonatomic, retain) NSString *windowName;
@property (nonatomic, retain) NSString *urlText;
@property (nonatomic, retain) NSDictionary *historyDict;
@property (nonatomic, retain) NSArray *params;
@property BOOL isKeepAlive;
@property BOOL enabledHistoryStack;
@property (nonatomic, retain) CATransition *transition;
@property UIModalTransitionStyle modalTransitionStyle;
@property UIModalPresentationStyle modalPresentationStyle;
@property CGSize popupContentSize;

@end

HMPWindowData

필드설명
windowName윈도우 이름
urlText경로
historyDict히스토리 정보
paramsWindow 에 전달할 정보
isKeepAlive해제 여부
enabledHistoryStack히스토리 저장 여부
transition애니메이션 정보
modalTransitionStyleUIModalTransitionStyle
modalPresentationStyleUIModalPresentationStyle
popupContentSize팝업 컨텐츠 사이즈
  

showWindow

showWindow 는 사용자가 window.json 에 설정해둔 윈도우를 이용해 화면에 내용을 출력하는 역할을 한다. 

Example (goToNativeWindow)

///////////////
// 3.10.18 이상
///////////////
let deviceAPI = DAPWindow()
let infoParam = DAPWindowGoToNativeWindowParam()
infoParam.winName = "customNativeWindow"
deviceAPI.execute(with: infoParam, completion: { (dict) in
}, failure: { (resultError) in
   guard let error = resultError else {
       return
    }
   
})


///////////////
// 3.10.18 이하
///////////////
let deviceAPI = DAPWindow()
let params = ["customNativeWindow", NSArray()] as [Any]
deviceAPI.execute(withActionName: "goToNativeWindow", params: params, completion: { (dict) in
}, failure: { (resultError) in
   guard let error = resultError else {
       return
    }
   
})

///////////////
// 3.10.18 이상
///////////////
DAPDeviceAPI *deviceAPI = [DAPWindow new];
DAPWindowGoToNativeWindowParam *infoParam = [DAPWindowGoToNativeWindowParam new];
infoParam.winName = @"customNativeWindow";
[deviceAPI executeWithParam:infoParam completion:^(NSDictionary *resultDict) {
} failure:^(NSError *error) {
}];

///////////////
// 3.10.18 이하
///////////////
DAPDeviceAPI *deviceAPI = [DAPWindow new];
NSArray *params = [NSArray arrayWithObjects:@"barcodeWindow", [NSArray array], nil];
[deviceAPI executeWithActionName:@"goToNativeWindow" params:params completion:^(NSDictionary *resultDict) {
    NSLog(@"%s %d\nresultDict %@", __PRETTY_FUNCTION__, __LINE__, resultDict);
} failure:^(NSError *error) {
    NSLog(@"%s %d\nerror %@", __PRETTY_FUNCTION__, __LINE__, error);
}];

 

Example (goToBizappWindow)

///////////////
// 3.10.18 이상
///////////////
let deviceAPI = DAPWindow()
let infoParam = DAPWindowGoToBizappWindowParam()
infoParam.winName = "customNativeWebWindow"
infoParam.bizAppId = "sub-sample"
deviceAPI.execute(with: infoParam, completion: { (dict) in
}, failure: { (resultError) in
   guard let error = resultError else {
       return
    }
   
})


///////////////
// 3.10.18 이하
///////////////
let deviceAPI = DAPWindow()
let params = ["customNativeWebWindow", "sub-sample"] as [Any]
deviceAPI.execute(withActionName: "goToBizappWindow", params: params, completion: { (dict) in
}, failure: { (resultError) in
   guard let error = resultError else {
       return
    }
   
})

///////////////
// 3.10.18 이상
///////////////
DAPDeviceAPI *deviceAPI = [DAPWindow new];
DAPWindowGoToBizappWindowParam *infoParam = [DAPWindowGoToBizappWindowParam new];
infoParam.winName = @"customNativeWebWindow";
infoParam.bizAppId = @"sub-sample";
[deviceAPI executeWithParam:infoParam completion:^(NSDictionary *resultDict) {
} failure:^(NSError *error) {
}];

///////////////
// 3.10.18 이하
///////////////
DAPDeviceAPI *deviceAPI = [DAPWindow new];
NSArray *params = [NSArray arrayWithObjects:@"defaultWebWindow", @"sub", nil];
[deviceAPI executeWithActionName:@"goToBizappWindow" params:params completion:^(NSDictionary *resultDict) {
    NSLog(@"%s %d\nresultDict %@", __PRETTY_FUNCTION__, __LINE__, resultDict);
} failure:^(NSError *error) {
    NSLog(@"%s %d\nerror %@", __PRETTY_FUNCTION__, __LINE__, error);
}];

showPopupWindow

showPopupWindow 는 window.json 에 설정해둔 팝업 윈도우를 이용해 화면에 내용을 출력하는 역할을 한다. 

Example (showNativeWebPopup)

///////////////
// 3.10.18 이상
///////////////
let deviceAPI = DAPWindow()
let infoParam = DAPWindowShowNativeWebPopupParam()
infoParam.winName = "customWebPopupWindow"
infoParam.url = "http://www.hsnc.co.kr/kr/mobile/index.do"
deviceAPI.execute(with: infoParam, completion: { (dict) in
   
}, failure: { (resultError) in
   guard let error = resultError else {
       return
    }
   
   self.showErrorDlg(error: error)
})


///////////////
// 3.10.18 이하
///////////////
let deviceAPI = DAPWindow()
let params = ["customWebPopupWindow", NSArray(), "http://www.hsnc.co.kr/kr/mobile/index.do"] as [Any]
deviceAPI.execute(withActionName: "showNativeWebPopup", params: params, completion: { (dict) in
   
}, failure: { (resultError) in
   guard let error = resultError else {
       return
    }
   
   self.showErrorDlg(error: error)
})

///////////////
// 3.10.18 이상
///////////////
DAPDeviceAPI *deviceAPI = [DAPWindow new];
DAPWindowShowNativeWebPopupParam *infoParam = [DAPWindowShowNativeWebPopupParam new];
infoParam.winName = @"customWebPopupWindow";
infoParam.url = @"http://www.hsnc.co.kr/kr/mobile/index.do";

[deviceAPI executeWithParam:infoParam completion:^(NSDictionary *resultDict) {
} failure:^(NSError *error) {
    [self showErrorDlgWithError:error];
}];


///////////////
// 3.10.18 이하
///////////////
DAPDeviceAPI *deviceAPI = [DAPWindow new];
NSArray *params = [NSArray arrayWithObjects:@"defaultWebPopupWindow", [NSArray array], @"http://hsnc.co.kr", nil];
[deviceAPI executeWithActionName:@"showNativeWebPopup" params:params completion:^(NSDictionary *resultDict) {
    NSLog(@"%s %d\nresultDict %@", __PRETTY_FUNCTION__, __LINE__, resultDict);
} failure:^(NSError *error) {
    NSLog(@"%s %d\nerror %@", __PRETTY_FUNCTION__, __LINE__, error);
}];

 

Example (showNativePopup)

///////////////
// 3.10.18 이상
///////////////
let deviceAPI = DAPWindow()
let infoParam = DAPWindowShowNativePopupParam()
infoParam.winName = "customPopupWindow"
deviceAPI.execute(with: infoParam, completion: { (dict) in
   
}, failure: { (resultError) in
   guard let error = resultError else {
       return
    }
   
})


///////////////
// 3.10.18 이하
///////////////
let deviceAPI = DAPWindow()
let params = ["customPopupWindow", NSArray()] as [Any]
deviceAPI.execute(withActionName: "showNativePopup", params: params, completion: { (dict) in
   
}, failure: { (resultError) in
   guard let error = resultError else {
       return
    }
   
})
///////////////
// 3.10.18 이상
///////////////
DAPDeviceAPI *deviceAPI = [DAPWindow new];
DAPWindowShowNativePopupParam *infoParam = [DAPWindowShowNativePopupParam new];
infoParam.winName = @"customPopupWindow";

[deviceAPI executeWithParam:infoParam completion:^(NSDictionary *resultDict) {
} failure:^(NSError *error) {
    [self showErrorDlgWithError:error];
}];

///////////////
// 3.10.18 이하
///////////////
DAPDeviceAPI *deviceAPI = [DAPWindow new];
NSArray *params = [NSArray arrayWithObjects:@"defaultPopupWindow", [NSArray array], nil];
[deviceAPI executeWithActionName:@"showNativePopup" params:params completion:^(NSDictionary *resultDict) {
    NSLog(@"%s %d\nresultDict %@", __PRETTY_FUNCTION__, __LINE__, resultDict);
} failure:^(NSError *error) {
    NSLog(@"%s %d\nerror %@", __PRETTY_FUNCTION__, __LINE__, error);
}];

goBack

현 윈도우가 Web 윈도우면 webview 의 history 에 따라 back 하게 되고 history 가 더 이상 존재하지 않으면 윈도우를 remove 한다.

Example

///////////////
// 3.10.18 이상
///////////////
let deviceAPI = DAPWindow()
let infoParam = DAPWindowGoBackParam()
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 = DAPWindow()
let params = [Any]()
deviceAPI.execute(withActionName: "goBack", 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 = [DAPWindow new];
DAPWindowGoBackParam *infoParam = [DAPWindowGoBackParam new];
[deviceAPI executeWithParam:infoParam completion:^(NSDictionary *resultDict) {
} failure:^(NSError *error) {
    [self showErrorDlgWithError:error];
}];


///////////////
// 3.10.18 이하
///////////////
DAPDeviceAPI *deviceAPI = [DAPWindow new];
NSArray *params = [NSArray array];
[deviceAPI executeWithActionName:@"goBack" params:params completion:^(NSDictionary *resultDict) {
    NSLog(@"%s %d\nresultDict %@", __PRETTY_FUNCTION__, __LINE__, resultDict);
} failure:^(NSError *error) {
    NSLog(@"%s %d\nerror %@", __PRETTY_FUNCTION__, __LINE__, error);
}];

clearHistory

현재 윈도우가 web 윈도우면 history 를 제거 한다

Example

///////////////
// 3.10.18 이상
///////////////
let deviceAPI = DAPWindow()
let infoParam = DAPWindowClearHistoryParam()
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 = DAPWindow()
let params = [Any]()
deviceAPI.execute(withActionName: "clearHistory", 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 = [DAPWindow new];
DAPWindowClearHistoryParam *infoParam = [DAPWindowClearHistoryParam new];
[deviceAPI executeWithParam:infoParam completion:^(NSDictionary *resultDict) {
} failure:^(NSError *error) {
    [self showErrorDlgWithError:error];
}];

///////////////
// 3.10.18 이하
///////////////
DAPDeviceAPI *deviceAPI = [DAPWindow new];
NSArray *params = [NSArray array];
[deviceAPI executeWithActionName:@"clearHistory" params:params completion:^(NSDictionary *resultDict) {
    NSLog(@"%s %d\nresultDict %@", __PRETTY_FUNCTION__, __LINE__, resultDict);
} failure:^(NSError *error) {
    NSLog(@"%s %d\nerror %@", __PRETTY_FUNCTION__, __LINE__, error);
}];

canGoBack

현재 윈도우가 web 윈도우면 webview 에 history 를 파악하여 back 이 가능한 지 유/무 를 전달 받는다

Example

///////////////
// 3.10.18 이상
///////////////
let deviceAPI = DAPWindow()
let infoParam = DAPWindowCanGoBackParam()
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 = DAPWindow()
let params = [Any]()
deviceAPI.execute(withActionName: "canGoBack", 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 = [DAPWindow new];
DAPWindowCanGoBackParam *infoParam = [DAPWindowCanGoBackParam new];
[deviceAPI executeWithParam:infoParam completion:^(NSDictionary *resultDict) {
} failure:^(NSError *error) {
    [self showErrorDlgWithError:error];
}];


///////////////
// 3.10.18 이하
///////////////
DAPDeviceAPI *deviceAPI = [DAPWindow new];
NSArray *params = [NSArray array];
[deviceAPI executeWithActionName:@"canGoBack" params:params completion:^(NSDictionary *resultDict) {
    NSLog(@"%s %d\nresultDict %@", __PRETTY_FUNCTION__, __LINE__, resultDict);
} failure:^(NSError *error) {
    NSLog(@"%s %d\nerror %@", __PRETTY_FUNCTION__, __LINE__, error);
}];


alert

경고창을 띄운다

Example

///////////////
// 3.10.18 이상
///////////////
let deviceAPI = DAPWindow()
let infoParam = DAPWindowAlertParam()
infoParam.title = NSLocalizedString("app_alert_show_title", comment: "")
infoParam.message = NSLocalizedString("app_window_alert_message", comment: "")
deviceAPI.execute(with: infoParam, completion: { (dict) in
}, failure: { (resultError) in
   guard let error = resultError else {
       return
    }
   
})


///////////////
// 3.10.18 이하
///////////////
let deviceAPI = DAPWindow()
let params = [NSLocalizedString("app_alert_show_title", comment: ""), NSLocalizedString("app_window_alert_message", comment: "")] as [Any]
deviceAPI.execute(withActionName: "alert", params: params, completion: { (dict) in
}, failure: { (resultError) in
   guard let error = resultError else {
       return
    }
   
})

///////////////
// 3.10.18 이상
///////////////
DAPDeviceAPI *deviceAPI = [DAPWindow new];
DAPWindowAlertParam *infoParam = [DAPWindowAlertParam new];
infoParam.title = NSLocalizedString(@"app_alert_show_title", nil);
infoParam.message = NSLocalizedString(@"app_alert_show_message", nil);
[deviceAPI executeWithParam:infoParam completion:^(NSDictionary *resultDict) {
} failure:^(NSError *error) {
    [self showErrorDlgWithError:error];
}];


///////////////
// 3.10.18 이하
///////////////
DAPDeviceAPI *deviceAPI = [DAPWindow new];
NSArray *params = [NSArray arrayWithObjects:@"title", @"contents", nil];
[deviceAPI executeWithActionName:@"alert" params:params completion:^(NSDictionary *resultDict) {
    NSLog(@"%s %d\nresultDict %@", __PRETTY_FUNCTION__, __LINE__, resultDict);
} failure:^(NSError *error) {
    NSLog(@"%s %d\nerror %@", __PRETTY_FUNCTION__, __LINE__, error);
}];

confirm

확인창을 띄운다

Example

///////////////
// 3.10.18 이상
///////////////
let deviceAPI = DAPWindow()
let infoParam = DAPWindowConfirmParam()
infoParam.title = NSLocalizedString("app_confirm_show_title", comment: "")
infoParam.message = NSLocalizedString("app_window_confirm_message", comment: "")
deviceAPI.execute(with: infoParam, completion: { (dict) in
}, failure: { (resultError) in
   guard let error = resultError else {
       return
    }
   
})


///////////////
// 3.10.18 이하
///////////////
let deviceAPI = DAPWindow()
let params = [NSLocalizedString("app_confirm_show_title", comment: ""), NSLocalizedString("app_window_confirm_message", comment: "")] as [Any]
deviceAPI.execute(withActionName: "confirm", params: params, completion: { (dict) in
}, failure: { (resultError) in
   guard let error = resultError else {
       return
    }
   
})

///////////////
// 3.10.18 이상
///////////////
DAPDeviceAPI *deviceAPI = [DAPWindow new];
DAPWindowConfirmParam *infoParam = [DAPWindowConfirmParam new];
infoParam.title = NSLocalizedString(@"app_confirm_show_title", nil);
infoParam.message = NSLocalizedString(@"app_window_confirm_message", nil);
[deviceAPI executeWithParam:infoParam completion:^(NSDictionary *resultDict) {
} failure:^(NSError *error) {
    [self showErrorDlgWithError:error];
}];


///////////////
// 3.10.18 이하
///////////////
DAPDeviceAPI *deviceAPI = [DAPWindow new];
NSArray *params = [NSArray arrayWithObjects:@"title", @"contents", nil];
[deviceAPI executeWithActionName:@"confirm" params:params completion:^(NSDictionary *resultDict) {
    NSLog(@"%s %d\nresultDict %@", __PRETTY_FUNCTION__, __LINE__, resultDict);
} failure:^(NSError *error) {
    NSLog(@"%s %d\nerror %@", __PRETTY_FUNCTION__, __LINE__, error);
}];

showLoadingScreen

로딩 다이얼로그를 띄운다

Example

///////////////
// 3.10.18 이상
///////////////
let deviceAPI = DAPWindow()
let infoParam = DAPWindowShowLoadingScreenParam()
infoParam.message = String(format: NSLocalizedString("app_window_loadingscreen", comment: ""), 2)
deviceAPI.execute(with: infoParam, completion: { (dict) in
}, failure: { (resultError) in
   guard let error = resultError else {
       return
    }
   
})


///////////////
// 3.10.18 이하
///////////////
let deviceAPI = DAPWindow()
let params = [String(format: NSLocalizedString("app_window_loadingscreen", comment: ""), 2)]
deviceAPI.execute(withActionName: "showLoadingScreen", params: params, completion: { (dict) in
}, failure: { (resultError) in
   guard let error = resultError else {
       return
    }
   
})

///////////////
// 3.10.18 이상
///////////////
DAPDeviceAPI *deviceAPI = [DAPWindow new];
DAPWindowShowLoadingScreenParam *infoParam = [DAPWindowShowLoadingScreenParam new];
infoParam.message = [NSString stringWithFormat:NSLocalizedString(@"app_window_loadingscreen", nil), 2];
[deviceAPI executeWithParam:infoParam completion:^(NSDictionary *resultDict) {

} failure:^(NSError *error) {
    [self showErrorDlgWithError:error];
}];

///////////////
// 3.10.18 이하
///////////////
DAPDeviceAPI *deviceAPI = [DAPWindow new];
NSArray *params = [NSArray arrayWithObjects:@"message", nil];
[deviceAPI executeWithActionName:@"showLoadingScreen" params:params completion:^(NSDictionary *resultDict) {
    NSLog(@"%s %d\nresultDict %@", __PRETTY_FUNCTION__, __LINE__, resultDict);
} failure:^(NSError *error) {
    NSLog(@"%s %d\nerror %@", __PRETTY_FUNCTION__, __LINE__, error);
}];

hideLoadingScreen

로딩 다이얼로그를 닫는다

Example

///////////////
// 3.10.18 이상
///////////////
let deviceAPI = DAPWindow()
let infoParam = DAPWindowHideLoadingScreenParam()
deviceAPI.execute(with: infoParam, completion: { (dict) in
}, failure: { (resultError) in
   guard let error = resultError else {
       return
    }
   
})


///////////////
// 3.10.18 이하
///////////////
let deviceAPI = DAPWindow()
deviceAPI.execute(withActionName: "hideLoadingScreen", params: nil, completion: { (dict) in
}, failure: { (resultError) in
})

///////////////
// 3.10.18 이상
///////////////
DAPDeviceAPI *deviceAPI = [DAPWindow new];
DAPWindowHideLoadingScreenParam *infoParam = [DAPWindowHideLoadingScreenParam new];
[deviceAPI executeWithParam:infoParam completion:^(NSDictionary *resultDict) {
  
} failure:^(NSError *error) {
}];


///////////////
// 3.10.18 이하
///////////////
DAPDeviceAPI *deviceAPI = [DAPWindow new];
NSArray *params = [NSArray array];
[deviceAPI executeWithActionName:@"hideLoadingScreen" params:params completion:^(NSDictionary *resultDict) {
    NSLog(@"%s %d\nresultDict %@", __PRETTY_FUNCTION__, __LINE__, resultDict);
} failure:^(NSError *error) {
    NSLog(@"%s %d\nerror %@", __PRETTY_FUNCTION__, __LINE__, error);
}];

fullScreen

fullScreen는 프레임워크 구조상 지원하지 않습니다.

전체 화면으로 변경하거나 복구한다

Example

UIViewController Class
override func prefersStatusBarHidden() -> Bool {
  return true;
}
UIViewController Class
- (BOOL)prefersStatusBarHidden{
   return YES;
}

isFullscreen

isFullScreen는 3.0.0 버전 이상 부터 제공됩니다.

현재 화면이 전체 화면인지 유/무 를 반환 한다

Example

///////////////
// 3.10.18 이상
///////////////
let deviceAPI = DAPWindow()
let infoParam = DAPWindowIsFullScreenParam()
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 = DAPWindow()
let params = [Any]()
deviceAPI.execute(withActionName: "isFullScreen", 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 = [DAPWindow new];
DAPWindowIsFullScreenParam *infoParam = [DAPWindowIsFullScreenParam new];

[deviceAPI executeWithParam:infoParam completion:^(NSDictionary *resultDict) {
   NSString *textResult = NSLocalizedString(@"app_result_defaultscreen", nil);
   NSNumber *value = [resultDict objectForKey:kDeviceResult];
   if ([value boolValue] == YES) {
        textResult = NSLocalizedString(@"app_result_fullscreen", nil);
    }

    ResultData *resultData = [ResultData resultDataWithType:@"textResultDlg" resultObject:textResult];
    resultData.type = [@"textResultDlg" lowercaseString];
    [self showSuccessDlgWithResultData:resultData];
} failure:^(NSError *error) {
    [self showErrorDlgWithError:error];
}];


///////////////
// 3.10.18 이하
///////////////
DAPDeviceAPI *deviceAPI = [DAPWindow new];
[deviceAPI executeWithActionName:@"isFullScreen" params:nil completion:^(NSDictionary *resultDict) {
    NSLog(@"%s %d\nresultDict %@", __PRETTY_FUNCTION__, __LINE__, resultDict);
} failure:^(NSError *error) {
    NSLog(@"%s %d\nerror %@", __PRETTY_FUNCTION__, __LINE__, error);
}];

orientation

orientation는 3.0.0 버전 이상 부터 제공됩니다.

단말의 orientation 정보를 반환 한다

Example

///////////////
// 3.10.18 이상
///////////////
let deviceAPI = DAPWindow()
let infoParam = DAPWindowOrientationParam()
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 = DAPWindow()
let params = [Any]()
deviceAPI.execute(withActionName: "orientation", 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 = [DAPWindow new];
DAPWindowOrientationParam *infoParam = [DAPWindowOrientationParam new];
[deviceAPI executeWithParam:infoParam completion:^(NSDictionary *resultDict) {
   NSString *textResult = NSLocalizedString(@"app_result_landscape", nil);
   NSNumber *value = [resultDict objectForKey:kDeviceResult];
   if ([value boolValue] == YES) {
        textResult = NSLocalizedString(@"app_result_portrait", nil);
    }
   
    ResultData *resultData = [ResultData resultDataWithType:@"textResultDlg" resultObject:textResult];
    resultData.type = [@"textResultDlg" lowercaseString];
    [self showSuccessDlgWithResultData:resultData];
} failure:^(NSError *error) {
    [self showErrorDlgWithError:error];
}];


///////////////
// 3.10.18 이하
///////////////
DAPDeviceAPI *deviceAPI = [DAPWindow new];
[deviceAPI executeWithActionName:@"orientation" params:nil completion:^(NSDictionary *resultDict) {
    NSLog(@"%s %d\nresultDict %@", __PRETTY_FUNCTION__, __LINE__, resultDict);
} failure:^(NSError *error) {
    NSLog(@"%s %d\nerror %@", __PRETTY_FUNCTION__, __LINE__, error);
}];

exitApp

앱을 종료 한다

Example

///////////////
// 3.10.18 이상
///////////////
let deviceAPI = DAPWindow()
let infoParam = DAPWindowExitAppParam()
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 = DAPWindow()
let params = [Any]()
deviceAPI.execute(withActionName: "exitApp", 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 = [DAPWindow new];
DAPWindowExitAppParam *infoParam = [DAPWindowExitAppParam new];
[deviceAPI executeWithParam:infoParam completion:^(NSDictionary *resultDict) {
} failure:^(NSError *error) {
    [self showErrorDlgWithError:error];
}];


///////////////
// 3.10.18 이하
///////////////
DAPDeviceAPI *deviceAPI = [DAPWindow new];
NSArray *params = [NSArray array];
[deviceAPI executeWithActionName:@"exitApp" params:params completion:^(NSDictionary *resultDict) {
    NSLog(@"%s %d\nresultDict %@", __PRETTY_FUNCTION__, __LINE__, resultDict);
} failure:^(NSError *error) {
    NSLog(@"%s %d\nerror %@", __PRETTY_FUNCTION__, __LINE__, error);
}];