ThingsAddFailViewController.m 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. //
  2. // ThingsAddFailViewController.m
  3. // kneet2
  4. //
  5. // Created by Jason Lee on 11/13/15.
  6. // Copyright © 2015 ntels. All rights reserved.
  7. //
  8. #import "ThingsAddFailViewController.h"
  9. #import "ThingsAddIncludeViewController.h"
  10. #import "ThingsAddInitCompleteViewController.h"
  11. @interface ThingsAddFailViewController () {
  12. }
  13. @end
  14. #pragma mark - Class Definition
  15. @implementation ThingsAddFailViewController
  16. - (void)viewDidLoad {
  17. [super viewDidLoad];
  18. // Do any additional setup after loading the view.
  19. [self initUI];
  20. [self prepareViewDidLoad];
  21. }
  22. - (void)initUI {
  23. _imgThings.image = [_addDevice imgaeForAddDel];
  24. _lblTitle.text = [NSString stringWithFormat:@"%@ 추가 실패", _addDevice.prdName];
  25. }
  26. - (void)viewDidAppear:(BOOL)animated {
  27. [super viewDidAppear:animated];
  28. [UIView animateWithDuration:kfAnimationDur animations:^{
  29. _maskView.alpha = 0.7;
  30. } completion:^(BOOL finished) {
  31. _constraintPopViewTop.constant = (IPHONE_HEIGHT - _popView.height) / 2;
  32. [UIView animateWithDuration:kfAnimationDur animations:^{
  33. [self.view layoutIfNeeded];
  34. }];
  35. }];
  36. }
  37. - (void)prepareViewDidLoad {
  38. }
  39. #pragma mark - Main Logic
  40. #pragma mark - UI Events
  41. - (IBAction)btnRetryTouched:(id)sender {
  42. if ([[JDFacade facade].loginUser.homehubOnlineState isEqualToString:@"OFF"]) {
  43. [[JDFacade facade] toast:@"홈허브가 온라인 상태로\r연결되어 있을 때 시도해주세요"];
  44. return;
  45. }
  46. ThingsAddInitCompleteViewController *vc = [CommonUtil instantiateViewControllerWithIdentifier:@"ThingsAddInitCompleteViewController" storyboardName:@"Things"];
  47. vc.addDevice = _addDevice;
  48. vc.selectHub = _selectHub;
  49. [self showTransparencyModalView:vc];
  50. }
  51. - (IBAction)btnCancelTouched:(id)sender {
  52. [[JDFacade facade] dismissModalStack:YES completion:^{
  53. [[JDFacade facade] gotoWishMenu:KNMenuIdThings];
  54. }];
  55. }
  56. #pragma mark - MemoryWarning
  57. - (void)didReceiveMemoryWarning
  58. {
  59. [super didReceiveMemoryWarning];
  60. // Dispose of any resources that can be recreated.
  61. }
  62. @end