LoginViewController.m 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561
  1. //
  2. // LoginViewController.m
  3. // kneet
  4. //
  5. // Created by Jason Lee on 2/4/15.
  6. // Copyright (c) 2015 ntels. All rights reserved.
  7. //
  8. @import QuartzCore;
  9. #import "RequestHandler.h"
  10. #import "CustomTextField.h"
  11. #import "CustomButton.h"
  12. #import "JDJSONModel.h"
  13. #import "LoginModel.h"
  14. #import "LoginViewController.h"
  15. #import "CustomLabel.h"
  16. #import "CustomCheckBox.h"
  17. #import "KeychainItemWrapper.h"
  18. #import "NewMobileViewController.h"
  19. #import "ValidateUtil.h"
  20. #import "CustomAlertView.h"
  21. #import "CustomImageView.h"
  22. #import "PwdPopupView.h"
  23. //#import "MobilesOverViewController.h"
  24. //#import "InvitationListViewController.h"
  25. /**
  26. ID / PW Input Box Text Color
  27. - 기본 : kUITextColor01
  28. - Hint : kUITextColor03
  29. - Disable : kUITextColor06
  30. 로그인 유지 / 아이디 저장 Text Color : kUITextColor01
  31. 아이디 찾기 / 비밀번호 찾기 / 회원가입하기 Text Color
  32. - 아이디 찾기,비밀번호 찾기 : kUITextColor01
  33. - 회원가입 하기 : kUITextColor04
  34. **/
  35. @interface LoginViewController () <CustomTextFieldDelegate> {
  36. }
  37. @end
  38. #pragma mark - Class Definition
  39. @implementation LoginViewController
  40. - (void)viewDidLoad {
  41. [super viewDidLoad];
  42. // Do any additional setup after loading the view.
  43. [self initUI];
  44. [self prepareViewDidLoad];
  45. }
  46. - (void)initUI {
  47. [self.btnLogin setBackgroundImage:[UIImage imageNamed:@"img_btn_common_active"] forState:UIControlStateNormal capInsets:UIEdgeInsetsMake(kfTopInset,kfRightInset,kfBottomInset,kfLeftInset)];
  48. [self.btnLogin setBackgroundImage:[UIImage imageNamed:@"img_btn_common_press"] forState:UIControlStateHighlighted capInsets:UIEdgeInsetsMake(kfTopInset,kfRightInset,kfBottomInset,kfLeftInset)];
  49. [self.btnLogin setBackgroundImage:[UIImage imageNamed:@"img_btn_common_disable"] forState:UIControlStateDisabled capInsets:UIEdgeInsetsMake(kfTopInset,kfRightInset,kfBottomInset,kfLeftInset)];
  50. [self.lblFindId setHidden:YES];
  51. CGRect screen = [UIScreen mainScreen].bounds;
  52. if (screen.size.height == 480) {//iphone4s
  53. [_imgvBg setImage:[UIImage imageNamed:@"img_login_bg_4inch"]];
  54. } if (screen.size.height == 667.0f) {//iphone6
  55. _constraintLeftPadding.constant *= 1.25;
  56. _constraintRightPadding.constant *= 1.25;
  57. } else if (screen.size.height == 736.0f) {//iphone6 plus
  58. _constraintLeftPadding.constant *= 1.5;
  59. _constraintRightPadding.constant *= 1.5;
  60. }
  61. // [self.view layoutIfNeeded];
  62. _txtEmail.customTextFieldSuperview = CustomTextFieldSuperviewIsScrollView;
  63. _txtPasswd.customTextFieldSuperview = CustomTextFieldSuperviewIsScrollView;
  64. _txtPasswd.secureTextEntry = YES;
  65. _txtEmail.keyboardType = UIKeyboardTypeDefault;
  66. _txtPasswd.keyboardType = UIKeyboardTypeDefault;
  67. _txtEmail.returnKeyType = UIReturnKeyNext;
  68. _txtPasswd.returnKeyType = UIReturnKeyDone;
  69. _txtPasswd.delegate = self;
  70. //Localization
  71. [_chkAutoLogin setTitle:NSLocalizedString(@"로그인 유지", @"로그인 유지") forState:UIControlStateNormal];
  72. [_chkIdSave setTitle:NSLocalizedString(@"아이디 저장", @"아이디 저장") forState:UIControlStateNormal];
  73. _txtEmail.placeholder = NSLocalizedString(@"아이디", @"아이디");
  74. _txtPasswd.placeholder = NSLocalizedString(@"비밀번호", @"비밀번호");
  75. _lblSignUp.text = NSLocalizedString(@"회원가입하기", @"회원가입하기");
  76. _lblFindId.text = NSLocalizedString(@"아이디/비번찾기", @"아이디/비번찾기");
  77. // [_lblSignUp setUnderLine:_lblSignUp.text];
  78. [_lblSignUp addTouchEventHandler:^(id label) {
  79. [self lblSignUpTouched];
  80. }];
  81. [_lblFindId setUnderLine:_lblFindId.text];
  82. [_lblFindId addTouchEventHandler:^(id label) {
  83. [self lblFindIdTouched];
  84. }];
  85. }
  86. - (void)prepareViewDidLoad {
  87. [RequestHandler handler].authorization = nil;
  88. _chkAutoLogin.checked = [[[JDFacade facade] objectForKeyFromUserDefaults:USDEF_APP_AUTO_LOGIN] boolValue];
  89. _chkIdSave.checked = [[[JDFacade facade] objectForKeyFromUserDefaults:USDEF_APP_SAVE_ID] boolValue];
  90. if (_chkAutoLogin.checked) {
  91. [self requestAutoLogin];
  92. // _txtEmail.text = [[JDFacade facade] objectForKeyFromKeychain:USDEF_SESSION_LOGIN_ID];
  93. // _txtPasswd.text = [[JDFacade facade] objectForKeyFromKeychain:USDEF_SESSION_LOGIN_PWD];
  94. //
  95. // [self btnLogInTouched:_btnLogin];
  96. }
  97. if (_chkIdSave.checked) {
  98. NSLog(@"Save ID : %@", [[JDFacade facade] objectForKeyFromKeychain:USDEF_SESSION_LOGIN_ID]);
  99. _txtEmail.text = [[JDFacade facade] objectForKeyFromKeychain:USDEF_SESSION_LOGIN_ID];
  100. }
  101. }
  102. #pragma mark - Main Logic
  103. - (void)requestLogin {
  104. SocketRequestModel *request = [[SocketRequestModel alloc] initWithMsgType:MSG_TYPE_LOGIN];
  105. NSDictionary *param = @{@"member_id": [_txtEmail.text trim],
  106. @"password": [_txtPasswd.text trim],
  107. @"os_type": MOBILE_DEVICE_TYPE,
  108. @"device_token": [JDFacade facade].APNSToken ? [JDFacade facade].APNSToken : ksEmptyString};
  109. [request setRequestMsg:param];
  110. [self sendDataToSocket:request modelClass:[LoginModel class]];
  111. [[JDFacade facade] loadIndicator:YES allowUserInteraction:NO];
  112. // [[RequestHandler handler] sendAsyncPostRequestAPIPath:API_POST_SIGN_IN parameters:param modelClass:[LoginModel class] completion:^(id responseObject) {
  113. // if (!responseObject) {//응답결과가 잘못되었거나 없을 경우,
  114. // return;
  115. // }
  116. //
  117. // LoginModel *loginInfo = (LoginModel *)responseObject;
  118. // NSLog(@"%@", loginInfo);
  119. //
  120. // if (loginInfo) {//API 성공 ,함
  121. // [self actionForLoginSucceed:loginInfo];
  122. //
  123. // }
  124. // } failure:^(id errorObject) {
  125. // JDErrorModel *error = (JDErrorModel *)errorObject;
  126. //
  127. // if ([error.errorCode isEqualToString:API_RESPONSE_UNAUTHORIZED_EMAIL]) {//이메일 아이디 인증이 안 된 계정
  128. // [self actionForWaiting];
  129. // } else if ([error.errorCode isEqualToString:API_RESPONSE_UNAUTHORIZED_DEVICE]) {//새로운 단말 인증 필요
  130. // [self actionForNeedsRegisteringNewDevice:error.nickname];
  131. // } else if ([error.errorCode isEqualToString:API_RESPONSE_MOBILES_OVER]) {//단말 초과
  132. // [self actionForMobilesOver:error.deviceList];
  133. // } else {
  134. // [[JDFacade facade] alert:error.errorMessage];
  135. // }
  136. // }];
  137. }
  138. //자동로그인 요청
  139. - (void)requestAutoLogin {;
  140. //parameters
  141. // NSString *memberId = [[JDFacade facade] objectForKeyFromKeychain:USDEF_SESSION_LOGIN_ID];
  142. // NSString *authToken = [[JDFacade facade] objectForKeyFromKeychain:USDEF_SESSION_AUTOTOKEN];
  143. LoginModel *tmpInfo = [[LoginModel alloc] init];
  144. tmpInfo.memberId = [[JDFacade facade] objectForKeyFromKeychain:USDEF_SESSION_LOGIN_ID];
  145. tmpInfo.authToken = [[JDFacade facade] objectForKeyFromKeychain:USDEF_SESSION_AUTOTOKEN];
  146. // if ([authToken isEmptyString]) {
  147. // return;
  148. // }
  149. // NSLog(@"%@", authToken);
  150. // [RequestHandler handler].authorization = authToken;
  151. NSDictionary *parameter = @{@"Authorization": tmpInfo.authorization,
  152. @"device_token": [JDFacade facade].APNSToken ? [JDFacade facade].APNSToken : ksEmptyString,
  153. @"os_type": MOBILE_DEVICE_TYPE,
  154. @"message_type": @"auth.auto"};
  155. [self sendDataToSocket:parameter modelClass:[LoginModel class]];
  156. [[JDFacade facade] loadIndicator:YES allowUserInteraction:NO];
  157. // NSString *path = [NSString stringWithFormat:API_GET_SIGN_IN_AUTO];
  158. //
  159. // [[RequestHandler handler] sendAsyncGetRequestAPIPath:path parameters:parameter modelClass:[LoginModel class] completion:^(id responseObject) {
  160. // if (!responseObject) {//응답결과가 잘못되었거나 없을 경우,
  161. // return;
  162. // }
  163. //
  164. // LoginModel *loginInfo = (LoginModel *)responseObject;
  165. //
  166. // if (loginInfo) {//API 성공 ,함
  167. // [self actionForLoginSucceed:loginInfo];
  168. //
  169. // }
  170. // } failure:^(id errorObject) {
  171. // JDErrorModel *error = (JDErrorModel *)errorObject;
  172. //
  173. // if ([error.errorCode isEqualToString:API_RESPONSE_UNAUTHORIZED_DEVICE]) {//새로운 단말 인증 필요
  174. // [self actionForNeedsRegisteringNewDevice:error.nickname];
  175. // } else {
  176. // [[JDFacade facade] alert:error.errorMessage];
  177. // }
  178. // }];
  179. }
  180. //인증 메일 재요청
  181. - (void)requestAuthMail {
  182. //parameters
  183. NSDictionary *parameter = @{@"email_id": [JDFacade facade].tmpEmailId};
  184. NSString *path = [NSString stringWithFormat:API_POST_AUTH_MAIL];
  185. [[RequestHandler handler] sendAsyncPostRequestAPIPath:path parameters:parameter modelClass:[JDJSONModel class] completion:^(id responseObject) {
  186. if (!responseObject) {//응답결과가 잘못되었거나 없을 경우,
  187. return;
  188. }
  189. JDJSONModel *result = (JDJSONModel *) responseObject;
  190. if (result) {//API 성공 ,
  191. [[JDFacade facade] toast:NSLocalizedString(@"인증 메일이 발송되었습니다", @"인증 메일이 발송되었습니다")];
  192. }
  193. } failure:^(id errorObject) {
  194. JDErrorModel *error = (JDErrorModel *)errorObject;
  195. [[JDFacade facade] alert:error.errorMessage];
  196. }];
  197. }
  198. //로그인 이후 처리.
  199. - (void)actionForLoginSucceed:(LoginModel *)loginInfo {
  200. if (loginInfo) {//API 성공함
  201. [JDFacade facade].loginUser = loginInfo;
  202. // [JDFacade facade].loginUser.gradeCode = KNEET_MEMBER_MASTER;
  203. // [JDFacade facade].loginUser.level = 90;
  204. NSLog(@"%@", [JDFacade facade].loginUser);
  205. if ([[JDFacade facade].loginUser.emailId isEqualToString:[JDFacade facade].tmpEmailId]) {
  206. [JDFacade facade].tmpEmailId = ksEmptyString;
  207. }
  208. if ([[JDFacade facade].loginUser.emailId isEqualToString:[JDFacade facade].loginUser.newEmailId]) {//이메일 변경 요청 중
  209. [JDFacade facade].loginUser.newEmailId = ksEmptyString;
  210. }
  211. [RequestHandler handler].authorization = loginInfo.authorization;
  212. [[JDFacade facade] storeObjectToUserDefaults:@(_chkAutoLogin.checked) forKey:USDEF_APP_AUTO_LOGIN];
  213. [[JDFacade facade] storeObjectToUserDefaults:@(_chkIdSave.checked) forKey:USDEF_APP_SAVE_ID];
  214. if (_chkAutoLogin.checked) {//자동로그인 설정 시, 인증 토큰 저장
  215. [[JDFacade facade] storeObjectToKeychain:loginInfo.memberId forKey:USDEF_SESSION_LOGIN_ID];
  216. [[JDFacade facade] storeObjectToKeychain:loginInfo.authToken forKey:USDEF_SESSION_AUTOTOKEN];
  217. } else {
  218. [[JDFacade facade] removeObjectAtKeychain:USDEF_SESSION_AUTOTOKEN];
  219. [[JDFacade facade] removeObjectAtKeychain:USDEF_SESSION_LOGIN_PWD];
  220. if (!_chkIdSave.checked) {
  221. [[JDFacade facade] removeObjectAtKeychain:USDEF_SESSION_LOGIN_ID];
  222. }
  223. }
  224. if (_chkIdSave.checked) {
  225. [[JDFacade facade] storeObjectToKeychain:[_txtEmail.text trim] forKey:USDEF_SESSION_LOGIN_ID];
  226. } else {
  227. if (!_chkAutoLogin.checked) {
  228. [[JDFacade facade] removeObjectAtKeychain:USDEF_SESSION_LOGIN_ID];
  229. }
  230. }
  231. [self actionAfterLogin];
  232. }
  233. }
  234. //홈그룹 체크 및 대시보드 이동
  235. - (void)actionAfterLogin {
  236. if ([[JDFacade facade].loginUser.invitationsCount integerValue] > 0) {
  237. [self actionForInvitation];
  238. return;
  239. }
  240. [self actionAfterInvitaion];
  241. }
  242. //초대알림 화면으로 이동
  243. - (void)actionForInvitation {
  244. [[JDFacade facade] loadInvitationView];
  245. }
  246. //초대화면 액션이 종료된 후,
  247. - (void)actionAfterInvitaion {
  248. //메인으로 이동
  249. [self gotoMainView];
  250. }
  251. //새로운 단말 인증 필요 - 화면 이동
  252. - (void)actionForNeedsRegisteringNewDevice:(NSString *)nickname {
  253. NewMobileViewController *vc = (NewMobileViewController *)[CommonUtil instantiateViewControllerWithIdentifier:@"NewMobileViewController" storyboardName:@"SignUp"];
  254. vc.checkedAutoLogin = _chkAutoLogin.checked;
  255. vc.nickname = nickname;
  256. [[JDFacade facade] presentViewControllerByPush:vc pvc:self];
  257. }
  258. //단말대수 초과
  259. - (void)actionForMobilesOver:(NSArray<MobileDeviceModel> *)deviceList {
  260. //SHA-2
  261. }
  262. //인증대기중 - 화면 이동
  263. - (void)actionForWaiting {
  264. NSString *message1 = [NSString stringWithFormat:@"%@에서\n인증 메일을 확인하세요", [JDFacade facade].tmpEmailId];
  265. NSString *message2 = @"\n\n메일을 확인할 수 없는 경우에는\n스팸 메일함을 확인해보세요";
  266. CustomAlertView *alert = [[CustomAlertView alloc] initWithTitle:@"메일을 확인하세요" message:[NSString stringWithFormat:@"%@%@", message1, message2] delegate:nil OKButtonTitle:@"확인" cancelButtonTitle:nil];
  267. [alert.lblMessage1 setColor:kUITextColor02 text:message1];
  268. [alert showWithCompletion:^(CustomAlertView *alertView, NSInteger buttonIndex) {
  269. if (buttonIndex == 1) {//재발송
  270. [self requestAuthMail];
  271. }
  272. }];
  273. }
  274. - (void)gotoMainView {
  275. // UIViewController *vc = [CommonUtil instantiateViewControllerWithIdentifier:@"SignUpCompleteViewController" storyboardName:@"SignUp"];
  276. UIViewController *vc = [CommonUtil instantiateViewControllerWithIdentifier:@"MainViewController" storyboardName:@"Main"];
  277. [JDFacade facade].mainViewController = (MainViewController *)vc;
  278. [[JDFacade facade].appDelegate.window setRootViewController:vc];
  279. }
  280. - (void)requestLogout {
  281. [JDFacade facade].loginUser = nil;
  282. [self actionAfterLogout];
  283. // NSDictionary *param = @{API_AUTHORIZATION_KEY: [[JDFacade facade].loginUser authorization],
  284. // @"message_type": @"auth.out"};
  285. //
  286. // [self sendDataToSocket:param];
  287. //parameters
  288. // [self actionAfterLogout];
  289. // NSString *path = [NSString stringWithFormat:API_POST_SIGN_OUT];
  290. //
  291. // [[RequestHandler handler] sendAsyncGetRequestAPIPath:path parameters:nil modelClass:[JDJSONModel class] completion:^(id responseObject) {
  292. // [self actionAfterLogout];
  293. //
  294. // } failure:^(id errorObject) {
  295. // JDErrorModel *error = (JDErrorModel *)errorObject;
  296. // [[JDFacade facade] alert:error.errorMessage];
  297. // }];
  298. }
  299. - (void)actionAfterLogout {
  300. //자동 로그인 설정 - 취소
  301. [[JDFacade facade] storeObjectToUserDefaults:@(NO) forKey:USDEF_APP_AUTO_LOGIN];
  302. [[JDFacade facade] removeObjectAtKeychain:USDEF_SESSION_AUTOTOKEN];
  303. if (![[[JDFacade facade] objectForKeyFromUserDefaults:USDEF_APP_SAVE_ID] boolValue]) {
  304. [[JDFacade facade] removeObjectAtKeychain:USDEF_SESSION_LOGIN_ID];
  305. }
  306. [JDFacade facade].loginUser = nil;
  307. [self closeSocket];
  308. //root view 변경
  309. [[JDFacade facade].appDelegate.window setRootViewController:self];
  310. }
  311. #pragma mark - UI Events
  312. - (IBAction)btnLogInTouched:(id)sender {
  313. #ifdef DEBUG_MODE
  314. if ([_txtEmail.text isEmptyString]) {
  315. _txtEmail.text = @"asura77";
  316. }
  317. if ([_txtPasswd.text isEmptyString]) {
  318. _txtPasswd.text = @"09767955";
  319. }
  320. #endif
  321. // TODO : 아이디 형식 검사할것
  322. // if (![ValidateUtil validateTextfiled:_txtEmail type:ValidateTypeEmail title:@"이메일" ]) {
  323. // return;
  324. // }
  325. if (![ValidateUtil validateTextfiled:_txtEmail type:ValidateTypeNull title:@"비밀번호" ]) {
  326. return;
  327. }
  328. [JDFacade facade].tmpEmailId = [_txtEmail.text trim];
  329. [JDFacade facade].tmpPassword = [_txtPasswd.text trim];
  330. [self requestLogin];
  331. }
  332. //회원가입 호출
  333. - (void)lblSignUpTouched {
  334. UIViewController *vc = [CommonUtil instantiateViewControllerWithIdentifier:@"AgreementViewController" storyboardName:@"SignUp"];
  335. UINavigationController *m_navi =[[UINavigationController alloc]initWithRootViewController:vc];
  336. [self presentViewController:m_navi animated:YES completion:nil];
  337. }
  338. - (void)lblFindIdTouched {
  339. UIViewController *vc = [CommonUtil instantiateViewControllerWithIdentifier:@"ResetPwdViewController" storyboardName:@"SignUp"];
  340. [self presentViewController:vc animated:YES completion:nil];
  341. }
  342. // 아이디 찾기 호출
  343. - (IBAction)btnIdFindTouched:(id)sender {
  344. NSLog(@"아이디 찾기");
  345. UIViewController *vc = [CommonUtil instantiateViewControllerWithIdentifier:@"IdFindViewController" storyboardName:@"SignUp"];
  346. UINavigationController *m_navi =[[UINavigationController alloc]initWithRootViewController:vc];
  347. [self presentViewController:m_navi animated:YES completion:nil];
  348. }
  349. // 비밀번호 찾기 호출
  350. - (IBAction)btnPwFindTouched:(id)sender {
  351. NSLog(@"비밀번호 찾기");
  352. UIViewController *vc = [CommonUtil instantiateViewControllerWithIdentifier:@"PwFindViewController" storyboardName:@"SignUp"];
  353. UINavigationController *m_navi =[[UINavigationController alloc]initWithRootViewController:vc];
  354. [self presentViewController:m_navi animated:YES completion:nil];
  355. }
  356. #pragma mark - CustomTextField
  357. - (BOOL)textFieldShouldReturn:(UITextField *)textField {
  358. if ([textField isEqual:_txtPasswd])
  359. {
  360. [self btnLogInTouched:nil];
  361. }
  362. if ([textField isEqual:_txtEmail])
  363. {
  364. [_txtPasswd becomeFirstResponder];
  365. }
  366. return YES;
  367. }
  368. #pragma mark - SocketService
  369. - (void) socketDidReceiveMessage:(id)message result:(SocketModel *)result
  370. {
  371. NSLog(@"Result Info : %@", result);
  372. NSLog(@"Result Info : %@", message);
  373. SWITCH(result.messageType)
  374. {
  375. CASE (@"auth")
  376. {
  377. [[JDFacade facade] loadIndicator:NO allowUserInteraction:YES];
  378. if (result.isSuccess) {
  379. LoginModel *loginInfo = (LoginModel *)message;
  380. [self actionForLoginSucceed:loginInfo];
  381. }
  382. else
  383. {
  384. [[JDFacade facade] toast:result.resultMsg];
  385. }
  386. break;
  387. }
  388. CASE (@"auth.auto")
  389. {
  390. [[JDFacade facade] loadIndicator:NO allowUserInteraction:YES];
  391. if (result.isSuccess) {
  392. LoginModel *loginInfo = (LoginModel *)message;
  393. loginInfo.memberId = [[JDFacade facade] objectForKeyFromKeychain:USDEF_SESSION_LOGIN_ID];
  394. loginInfo.authToken = [[JDFacade facade] objectForKeyFromKeychain:USDEF_SESSION_AUTOTOKEN];
  395. [self actionForLoginSucceed:loginInfo];
  396. }
  397. else
  398. {
  399. [[JDFacade facade] toast:result.resultMsg];
  400. }
  401. break;
  402. }
  403. CASE(@"auth.out")
  404. {
  405. if (result.isSuccess) {
  406. [self actionAfterLogout];
  407. }
  408. else {
  409. NSLog(@"Result Info : %@", result);
  410. }
  411. }
  412. DEFAULT
  413. {
  414. break;
  415. }
  416. }
  417. }
  418. - (void) socketDidFailWithError:(NSError *)error {
  419. [[JDFacade facade] loadIndicator:NO allowUserInteraction:YES];
  420. }
  421. #pragma mark - MemoryWarning
  422. - (void)didReceiveMemoryWarning
  423. {
  424. [super didReceiveMemoryWarning];
  425. // Dispose of any resources that can be recreated.
  426. }
  427. @end