ThingsAddFailViewController.m 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  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. }
  24. - (void)viewDidAppear:(BOOL)animated {
  25. [super viewDidAppear:animated];
  26. [UIView animateWithDuration:kfAnimationDur animations:^{
  27. _maskView.alpha = 0.7;
  28. } completion:^(BOOL finished) {
  29. _constraintPopViewTop.constant = (IPHONE_HEIGHT - _popView.height) / 2;
  30. [UIView animateWithDuration:kfAnimationDur animations:^{
  31. [self.view layoutIfNeeded];
  32. }];
  33. }];
  34. }
  35. - (void)prepareViewDidLoad {
  36. }
  37. #pragma mark - Main Logic
  38. #pragma mark - UI Events
  39. - (IBAction)btnRetryTouched:(id)sender {
  40. if ([[JDFacade facade].loginUser.homehubOnlineState isEqualToString:@"OFF"]) {
  41. [[JDFacade facade] toast:@"홈허브가 온라인 상태로\r연결되어 있을 때 시도해주세요"];
  42. return;
  43. }
  44. ThingsAddInitCompleteViewController *vc = [CommonUtil instantiateViewControllerWithIdentifier:@"ThingsAddInitCompleteViewController" storyboardName:@"Things"];
  45. vc.addDevice = _addDevice;
  46. [self showTransparencyModalView:vc];
  47. }
  48. - (IBAction)btnCancelTouched:(id)sender {
  49. [[JDFacade facade] dismissModalStack:YES completion:^{
  50. [[JDFacade facade] gotoWishMenu:KNMenuIdThings];
  51. }];
  52. }
  53. #pragma mark - MemoryWarning
  54. - (void)didReceiveMemoryWarning
  55. {
  56. [super didReceiveMemoryWarning];
  57. // Dispose of any resources that can be recreated.
  58. }
  59. @end