SettingsViewController.m 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552
  1. //
  2. // SettingsViewController.m
  3. // kneet2
  4. //
  5. // Created by Jason Lee on 10/8/15.
  6. // Copyright (c) 2015 ntels. All rights reserved.
  7. //
  8. #import "JDObject.h"
  9. #import "RequestHandler.h"
  10. #import "CustomLabel.h"
  11. #import "CustomButton.h"
  12. #import "CustomCheckBox.h"
  13. #import "UIButton+WebCache.h"
  14. #import "CustomTableView.h"
  15. #import "WebBrowseViewController.h"
  16. #import "PwdPopupView.h"
  17. #import "ImageUtil.h"
  18. #import "SettingsViewController.h"
  19. #import "AdminAuthPopupView.h"
  20. #import "DeleteAccountPopupView.h"
  21. #import "ChangeNamePopupView.h"
  22. #import "ConfirmPasswdPopupView.h"
  23. #import "ChangeEmailPopupView.h"
  24. #import "ChangePhotoPopupView.h"
  25. #import "ManagementViewController.h"
  26. #define kiAccountCellHeight 555
  27. #define kiNotiCellHeight 137
  28. #define kiServiceCellHeight 143
  29. #define kiVersionCellHeight 103
  30. #define kiDeleteCellHeight 82
  31. //#define kiPasswdCellHeight 135
  32. #define kiPhotoAlbum 0
  33. #define kiPhotoCamera 1
  34. #define kiPhotoDelete 2
  35. @implementation SettingsAccountTableViewCell
  36. - (void)awakeFromNib {
  37. }
  38. - (void)didMoveToSuperview {
  39. // [_lblChangeNickname setUnderLine:_lblChangeNickname.text];
  40. // [_lblChangePassword setUnderLine:_lblChangePassword.text];
  41. // [_lblChangeEmail setUnderLine:_lblChangeEmail.text];
  42. // [_lblChangePassword setHidden:NO];
  43. [_lblChangeEmail setHidden:YES];
  44. [_lblEmailWaiting setHidden:YES];
  45. _btnProfile.layer.frame = CGRectMake(0, 0, _btnProfile.frame.size.width, _btnProfile.frame.size.width);
  46. _btnProfile.layer.masksToBounds = YES;
  47. _btnProfile.layer.cornerRadius = _btnProfile.frame.size.width/2;
  48. _contraintEmailChangeBottom.constant = ![JDFacade facade].tmpEmailId || [[JDFacade facade].tmpEmailId isEmptyString] ? 18 : 45;
  49. _lblEmailWaiting.hidden = ![JDFacade facade].tmpEmailId || [[JDFacade facade].tmpEmailId isEmptyString];
  50. [self layoutIfNeeded];
  51. }
  52. @end
  53. @implementation SettingsNotificationTableViewCell
  54. @end
  55. @implementation SettingsServiceTableViewCell
  56. - (void)didMoveToSuperview {
  57. }
  58. @end
  59. @implementation SettingsVersionTableViewCell
  60. @end
  61. @implementation SettingsDeleteTableViewCell
  62. @end
  63. //@implementation SettingsPasswdTableViewCell
  64. //
  65. //@end
  66. @interface SettingsViewController () <UITableViewDataSource, UITableViewDelegate, ImageUtilDelegate,changePhotoDelegate> {
  67. CustomCheckBox *_chkAutoLogin, *_chkHomeModeChange, *_chkHomeEmptyChange;
  68. CustomButton *_btnProfile;
  69. BOOL _isNotFirstLoading;
  70. DashboardModel *_dashboard;
  71. ImageUtil *_imageUtil;
  72. }
  73. @end
  74. #pragma mark - Class Definition
  75. @implementation SettingsViewController
  76. @synthesize dashboardModel;
  77. - (void)viewDidLoad {
  78. [super viewDidLoad];
  79. // Do any additional setup after loading the view.
  80. [self initUI];
  81. [self prepareViewDidLoad];
  82. }
  83. - (void)viewWillAppear:(BOOL)animated {
  84. [_tableView reloadData];
  85. [super viewWillAppear:animated];
  86. }
  87. - (void)initUI {
  88. [self.navigationController.navigationBar setHidden:YES];
  89. self.navigationController.interactivePopGestureRecognizer.enabled = NO;
  90. //set tableview option
  91. [self initTableViewAsDefaultStyle:_tableView];
  92. }
  93. - (void)prepareViewDidLoad {
  94. }
  95. #pragma mark - Main Logic
  96. - (void)requestUpdatePushSetting:(NSDictionary *)parameter {
  97. //parameters
  98. NSString *path = [NSString stringWithFormat:API_POST_PUSH_SETTINGS];
  99. [[RequestHandler handler] sendAsyncPostRequestAPIPath:path parameters:parameter modelClass:[JDJSONModel class] completion:^(id responseObject) {
  100. NSString *msg = nil;
  101. if ([parameter hasKey:@"push_type_mode_chg_yn"]) {
  102. BOOL isNotifyHomeModeChange = [[parameter valueForKey:@"push_type_mode_chg_yn"] boolValue];
  103. if ([[JDFacade facade].loginUser.pushTypeModeChgYn boolValue] != isNotifyHomeModeChange) {
  104. msg = isNotifyHomeModeChange ? @"지금부터 홈모드가 바뀔 때\n푸시 알림을 받습니다" : @"홈모드 변경 알림을 해제합니다";
  105. [JDFacade facade].loginUser.pushTypeModeChgYn = [parameter valueForKey:@"push_type_mode_chg_yn"];
  106. }
  107. } else if ([parameter hasKey:@"push_type_prsnc_chg_yn"]) {//와이파이,
  108. BOOL isNotifyExecutingRules = [[parameter valueForKey:@"push_type_prsnc_chg_yn"] boolValue];
  109. if ([[JDFacade facade].loginUser.pushTypePrsncChgYn boolValue] != isNotifyExecutingRules) {
  110. msg = isNotifyExecutingRules ? @"지금부터 집이 빌 때\n푸시 알림을 받습니다" : @"빈 집 알림을 해제합니다";
  111. [JDFacade facade].loginUser.pushTypePrsncChgYn = [parameter valueForKey:@"push_type_prsnc_chg_yn"];
  112. }
  113. }
  114. [[JDFacade facade] toast:msg];
  115. } failure:^(id errorObject) {
  116. JDErrorModel *error = (JDErrorModel *)errorObject;
  117. [[JDFacade facade] alert:error.errorMessage];
  118. }];
  119. }
  120. - (void)requestUpdateProfileImage:(UIImage *)profileImage {
  121. NSDictionary *parameter;
  122. BOOL imageIsNull = NO;
  123. if (profileImage == nil) { // 사진 삭제
  124. parameter = @{@"image_file": @""};
  125. imageIsNull = YES;
  126. } else {
  127. parameter = @{@"image_file": profileImage};
  128. imageIsNull = NO;
  129. }
  130. //parameters
  131. // NSDictionary *parameter = @{@"image_file": profileImage};
  132. // NSString *path = [NSString stringWithFormat:API_POST_MEMBER_UPDATE_IMAGE];
  133. NSString *path = [[JDFacade facade] getUrlWithCustGroupIDAndMemberID:API_POST_MEMBER_UPDATE_IMAGE];
  134. [[RequestHandler handler] sendAsyncPostRequestAPIPath:path parameters:parameter modelClass:[LoginModel class] completion:^(id responseObject) {
  135. if (!responseObject) {//응답결과가 잘못되었거나 없을 경우,
  136. return;
  137. }
  138. LoginModel *response = (LoginModel *) responseObject;
  139. NSLog(@"responseObject : %@",responseObject);
  140. if (response) {//API 성공
  141. if (!imageIsNull) {
  142. [_btnProfile sd_setBackgroundImageWithURL:[NSURL URLWithString:response.imageFile] forState:UIControlStateNormal placeholderImage:nil options:SDWebImageRefreshCached];
  143. [JDFacade facade].loginUser.profileImage = response.imageFile;
  144. [[JDFacade facade] toast:@"프로필 이미지를 변경했습니다"];
  145. } else {
  146. NSString *msg = @"사진이 삭제 되었습니다.";
  147. [[JDFacade facade] alertTitle:@"알림" message: msg completionHander:nil];
  148. [_btnProfile sd_setBackgroundImageWithURL:[NSURL URLWithString:response.imageFile] forState:UIControlStateNormal placeholderImage:nil options:SDWebImageRefreshCached];
  149. [JDFacade facade].loginUser.profileImage = response.imageFile;
  150. }
  151. }
  152. } failure:^(id errorObject) {
  153. JDErrorModel *error = (JDErrorModel *)errorObject;
  154. [[JDFacade facade] alert:error.errorMessage];
  155. }];
  156. }
  157. #pragma mark - UITableView DataSource & Delegate
  158. #pragma mark - UITableView DataSource & Delegate
  159. - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
  160. return 5;
  161. }
  162. - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
  163. return 1;
  164. }
  165. - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
  166. CGFloat height = 0.0f;
  167. if (indexPath.section == 0) {
  168. // height = ![JDFacade facade].tmpEmailId || [[JDFacade facade].tmpEmailId isEmptyString] ? 331-27 : 331;
  169. height = kiAccountCellHeight;
  170. } else if (indexPath.section == 1) {//notification view
  171. // height = [JDFacade facade].loginUser.isHomehubOnline ? 317-56 : 317;
  172. height = kiNotiCellHeight;
  173. } else if (indexPath.section == 2) {
  174. height = kiServiceCellHeight;
  175. } else if (indexPath.section == 3) {
  176. height = kiVersionCellHeight;
  177. } else if (indexPath.section == 4) {
  178. height = kiDeleteCellHeight;
  179. }
  180. // else if (indexPath.section == 5) {
  181. // height = kiPasswdCellHeight;
  182. // }
  183. return height;
  184. }
  185. - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
  186. UITableViewCell *cell = nil;//[super tableView:tableView cellForRowAtIndexPath:indexPath];
  187. if (indexPath.section == 0) {//account cell
  188. SettingsAccountTableViewCell *tcell = [_tableView dequeueReusableCellWithIdentifier:@"AccountCellIdentifier"];
  189. tcell.lblNickname.text = [[JDFacade facade].loginUser.nickname isEqualToString:@""] ? @"사용자 이름을 등록해주세요.":[JDFacade facade].loginUser.nickname;
  190. tcell.lblEmail.text = [JDFacade facade].loginUser.memberId;
  191. if (!_btnProfile) {
  192. _btnProfile = tcell.btnProfile;
  193. }
  194. [_btnProfile sd_setBackgroundImageWithURL:[NSURL URLWithString:[JDFacade facade].loginUser.profileImage] forState:UIControlStateNormal placeholderImage:nil options:SDWebImageRefreshCached];
  195. tcell.lblPhoneNum.text = [CommonUtil formattedPhoneNumber:[JDFacade facade].loginUser.phone];
  196. //set checkbox
  197. if (!_chkAutoLogin) {
  198. _chkAutoLogin = tcell.chkAutoLogin;
  199. _chkAutoLogin.checked = [[[JDFacade facade] objectForKeyFromUserDefaults:USDEF_APP_AUTO_LOGIN] boolValue];
  200. }
  201. //set checkbox action
  202. if (![_chkAutoLogin actionsForTarget:self forControlEvent:UIControlEventTouchUpInside]) {
  203. [_chkAutoLogin addTarget:self action:@selector(chkAutoLoginTouched:) forControlEvents:UIControlEventTouchUpInside];
  204. }
  205. //set label action
  206. if (!tcell.lblChangeNickname.touchHandler) {
  207. [tcell.lblChangeNickname addTouchEventHandler:^(id label) {
  208. [self lblChangeNicknameTouched];
  209. }];
  210. }
  211. //set label action
  212. if (!tcell.lblChangePassword.touchHandler) {
  213. [tcell.lblChangePassword addTouchEventHandler:^(id label) {
  214. [self lblChangePasswordTouched];
  215. }];
  216. }
  217. //set email change action
  218. if (!tcell.lblChangeEmail.touchHandler) {
  219. [tcell.lblChangeEmail addTouchEventHandler:^(id label) {
  220. [self lblChangeEmailTouched];
  221. }];
  222. }
  223. //set Phone Number change action
  224. if (![tcell.btnChangeNum actionsForTarget:self forControlEvent:UIControlEventTouchUpInside]) {//set button target
  225. [tcell.btnChangeNum addTarget:self action:@selector(btnChangeNumTouched:) forControlEvents:UIControlEventTouchUpInside];
  226. }
  227. if (![tcell.btnLogout actionsForTarget:self forControlEvent:UIControlEventTouchUpInside]) {//set button target
  228. [tcell.btnLogout addTarget:self action:@selector(btnLogoutTouched:) forControlEvents:UIControlEventTouchUpInside];
  229. }
  230. if (![tcell.btnProfile actionsForTarget:self forControlEvent:UIControlEventTouchUpInside]) {//set button target
  231. [tcell.btnProfile addTarget:self action:@selector(btnProfileTouched:) forControlEvents:UIControlEventTouchUpInside];
  232. }
  233. if (![tcell.btnProfileSetting actionsForTarget:self forControlEvent:UIControlEventTouchUpInside]) {
  234. [tcell.btnProfileSetting addTarget:self action:@selector(btnProfileTouched:) forControlEvents:UIControlEventTouchUpInside];
  235. }
  236. cell = tcell;
  237. } else if (indexPath.section == 1) {//notification cell
  238. SettingsNotificationTableViewCell *tcell = [_tableView dequeueReusableCellWithIdentifier:@"NotificationCellIdentifier"];
  239. if ([JDFacade facade].loginUser.level < 90) {
  240. tcell.viewThingsSet.hidden = YES;
  241. } else {
  242. tcell.viewThingsSet.hidden = NO;
  243. }
  244. if (!_chkHomeModeChange) {
  245. _chkHomeModeChange = tcell.chkHomeModeChange;
  246. }
  247. // if (!_chkHomeEmptyChange) {
  248. // _chkHomeEmptyChange = tcell.chkHomeEmptyChange;
  249. // }
  250. if (!_isNotFirstLoading) {
  251. _isNotFirstLoading = YES;
  252. _chkHomeModeChange.checked = [[JDFacade facade].loginUser.pushTypeModeChgYn boolValue];
  253. // _chkHomeEmptyChange.checked = [[JDFacade facade].loginUser.pushTypePrsncChgYn boolValue];
  254. }
  255. if (![tcell.chkHomeModeChange actionsForTarget:self forControlEvent:UIControlEventTouchUpInside]) {
  256. [tcell.chkHomeModeChange addTarget:self action:@selector(chkHomeModeChangeTouched:) forControlEvents:UIControlEventTouchUpInside];
  257. }
  258. if (![tcell.btnThingsSet actionsForTarget:self forControlEvent:UIControlEventTouchUpInside]) {
  259. [tcell.btnThingsSet addTarget:self action:@selector(btnThingsSetTouched:) forControlEvents:UIControlEventTouchUpInside];
  260. }
  261. // if (![tcell.chkHomeEmptyChange actionsForTarget:self forControlEvent:UIControlEventTouchUpInside]) {
  262. // [tcell.chkHomeEmptyChange addTarget:self action:@selector(chkHomeEmptyChangeTouched:) forControlEvents:UIControlEventTouchUpInside];
  263. // }
  264. // tcell.homehubInfoView.hidden = [JDFacade facade].loginUser.isHomehubOnline;
  265. // if (tcell.homehubInfoView.hidden) {
  266. // tcell.constraintHomehubInfoViewHeight.constant = 0;
  267. // } else {
  268. // _chkHomeModeChange.enabled = NO;
  269. // _chkHomeEmptyChange.enabled = NO;
  270. // }
  271. cell = tcell;
  272. } else if (indexPath.section == 2) {//service info cell
  273. SettingsServiceTableViewCell *tcell = [_tableView dequeueReusableCellWithIdentifier:@"ServiceCellIdentifier"];
  274. if (![tcell.btnService actionsForTarget:self forControlEvent:UIControlEventTouchUpInside]) {
  275. [tcell.btnService addTarget:self action:@selector(btnServiceTouched:) forControlEvents:UIControlEventTouchUpInside];
  276. }
  277. if (![tcell.btnPolicy actionsForTarget:self forControlEvent:UIControlEventTouchUpInside]) {
  278. [tcell.btnPolicy addTarget:self action:@selector(btnPolicyTouched:) forControlEvents:UIControlEventTouchUpInside];
  279. }
  280. cell = tcell;
  281. } else if (indexPath.section == 3) {//version info cell
  282. SettingsVersionTableViewCell *tcell = [_tableView dequeueReusableCellWithIdentifier:@"VersionCellIdentifier"];
  283. tcell.lblVersion.text = [NSString stringWithFormat:@"현재 버전 : %@", [CommonUtil applicationShortVersion]];
  284. cell = tcell;
  285. } else if (indexPath.section == 4) {//Delete cell
  286. SettingsDeleteTableViewCell *tcell = [_tableView dequeueReusableCellWithIdentifier:@"DeleteCellIdentifier"];
  287. if (![tcell.btnDelete actionsForTarget:self forControlEvent:UIControlEventTouchUpInside]) {
  288. [tcell.btnDelete addTarget:self action:@selector(btnDeleteTouched:) forControlEvents:UIControlEventTouchUpInside];
  289. }
  290. cell = tcell;
  291. }
  292. // else if (indexPath.section == 5) {//Passwd info cell
  293. // SettingsPasswdTableViewCell *tcell = [_tableView dequeueReusableCellWithIdentifier:@"PasswdCellIdentifier"];
  294. //
  295. // if (![tcell.btnPassword actionsForTarget:self forControlEvent:UIControlEventTouchUpInside]) {
  296. // [tcell.btnPassword addTarget:self action:@selector(btnPasswordTouched:) forControlEvents:UIControlEventTouchUpInside];
  297. // }
  298. //
  299. // cell = tcell;
  300. // }
  301. cell.selectionStyle = UITableViewCellSelectionStyleNone;
  302. return cell;
  303. }
  304. - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
  305. [super tableView:tableView didSelectRowAtIndexPath:indexPath];
  306. }
  307. #pragma mark - ImageUtil Delegate
  308. - (void)didFinishPickingImage:(UIImage *)image {
  309. [self requestUpdateProfileImage:image];
  310. }
  311. #pragma mark - UI Events
  312. - (void)lblChangeNicknameTouched {
  313. // ChangeNamePopupView *popup = [[ChangeNamePopupView alloc] initFromNib];
  314. // [popup showWithCompletion:^(CustomAlertView *alertView, NSInteger buttonIndex) {
  315. // if (buttonIndex == 0) {//이름 변경 시,
  316. //
  317. // [_tableView reloadData];
  318. // }
  319. // }];
  320. UIViewController *vc = [CommonUtil instantiateViewControllerWithIdentifier:@"SettingsNameSetViewController" storyboardName:@"Settings"];
  321. // vc.providesPresentationContextTransitionStyle = YES;
  322. // vc.definesPresentationContext = YES;
  323. //
  324. // [vc setModalPresentationStyle:UIModalPresentationOverCurrentContext];
  325. //
  326. // [self presentViewController:vc animated:YES completion:nil];
  327. [self.navigationController pushViewController:vc animated:YES];
  328. }
  329. - (void)lblChangePasswordTouched {
  330. // ConfirmPasswdPopupView *popup = [[ConfirmPasswdPopupView alloc] initFromNib];
  331. // [popup show];
  332. UIViewController *vc = [CommonUtil instantiateViewControllerWithIdentifier:@"SettingsPasswdInputViewController" storyboardName:@"Settings"];
  333. [self.navigationController pushViewController:vc animated:YES];
  334. }
  335. - (void)lblChangeEmailTouched {
  336. ChangeEmailPopupView *popup = [[ChangeEmailPopupView alloc] initFromNib];
  337. [popup show];
  338. }
  339. - (void)btnProfileTouched:(id)sender {
  340. if (!_imageUtil) {
  341. _imageUtil = [[ImageUtil alloc] init];
  342. _imageUtil.delegate = self;
  343. }
  344. // [_imageUtil prepareImagePicker:self];
  345. ChangePhotoPopupView *popup = [[ChangePhotoPopupView alloc]initFromNib];
  346. [popup show];
  347. popup.delegate = self;
  348. }
  349. -(void)changeSelectPhotoType:(NSInteger)index{
  350. [_imageUtil setPresentViewController:self];
  351. if (index == kiPhotoAlbum) {
  352. [_imageUtil showImagePickerController:UIImagePickerControllerSourceTypeSavedPhotosAlbum];
  353. } else if (index == kiPhotoCamera){
  354. [_imageUtil showImagePickerController:UIImagePickerControllerSourceTypeCamera];
  355. } else if (index == kiPhotoDelete){
  356. // UIImage *image = [[UIImage alloc]init];
  357. [self requestUpdateProfileImage:[UIImage imageNamed:@""]];
  358. }
  359. }
  360. - (void)chkAutoLoginTouched:(id)sender {
  361. [[JDFacade facade] storeObjectToUserDefaults:@(_chkAutoLogin.checked) forKey:USDEF_APP_AUTO_LOGIN];
  362. if (_chkAutoLogin.checked) {//자동로그인 설정 시, 인증 토큰 저장
  363. [[JDFacade facade] storeObjectToKeychain:[JDFacade facade].loginUser.authToken forKey:USDEF_SESSION_AUTOTOKEN];
  364. } else {;
  365. [[JDFacade facade] removeObjectAtKeychain:USDEF_SESSION_AUTOTOKEN];
  366. }
  367. }
  368. - (void)btnLogoutTouched:(id)sender {
  369. [[JDFacade facade] logout];
  370. }
  371. - (void)btnChangeNumTouched:(id)sender {
  372. UIViewController *vc = [CommonUtil instantiateViewControllerWithIdentifier:@"SettingsNumChangeViewController" storyboardName:@"Settings"];
  373. [self.navigationController pushViewController:vc animated:YES];
  374. }
  375. //NoticationcationCell's action
  376. - (void)chkHomeModeChangeTouched:(id)sender {
  377. NSDictionary *parameter = @{@"push_type_mode_chg_yn" : _chkHomeModeChange.checked ? ksYES : ksNO};
  378. [self requestUpdatePushSetting:parameter];
  379. }
  380. //- (void)chkHomeEmptyChangeTouched:(id)sender {
  381. //
  382. // NSDictionary *parameter = @{@"push_type_prsnc_chg_yn" : _chkHomeEmptyChange.checked ? ksYES : ksNO};
  383. // [self requestUpdatePushSetting:parameter];
  384. //}
  385. - (void)btnThingsSetTouched:(id)sender{
  386. NSLog(@"홈모드별 동작할 장치 설정");
  387. }
  388. - (void)btnServiceTouched:(id)sender {
  389. NSString *URLString = [NSString stringWithFormat:@"%@%@", kWebLinkServer, URL_PATH_TERMS];
  390. [[JDFacade facade] loadURLExternalBrowser:URLString];
  391. }
  392. - (void)btnPolicyTouched:(id)sender {
  393. NSString *URLString = [NSString stringWithFormat:@"%@%@", kWebLinkServer, URL_PATH_POLICY];
  394. [[JDFacade facade] loadURLExternalBrowser:URLString];
  395. }
  396. //service passwd cell's action
  397. - (void)btnPasswordTouched:(id)sender {// 셋탑 설정
  398. AdminAuthPopupView *popup = [[AdminAuthPopupView alloc] initFromNib];
  399. [popup show];
  400. }
  401. - (void)btnDeleteTouched:(id)sender { // 계정 삭제
  402. DeleteAccountPopupView *popup = [[DeleteAccountPopupView alloc]initFromNib];
  403. [popup show];
  404. }
  405. - (IBAction)btnCloseTouched:(id)sender {
  406. [self dismissViewControllerAnimated:YES completion:nil];
  407. }
  408. #pragma mark - MemoryWarning
  409. - (void)didReceiveMemoryWarning
  410. {
  411. [super didReceiveMemoryWarning];
  412. // Dispose of any resources that can be recreated.
  413. }
  414. @end