ThingsAddFailViewController.m 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  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. // vc.providesPresentationContextTransitionStyle = YES;
  49. // vc.definesPresentationContext = YES;
  50. //
  51. // [vc setModalPresentationStyle:UIModalPresentationOverCurrentContext];
  52. //
  53. //// [self presentViewController:vc animated:YES completion:^{
  54. //// _maskView.alpha = 0.0f;
  55. //// }];
  56. // UIViewController *pvc = self.presentingViewController;
  57. // [self dismissViewControllerAnimated:NO completion:^{//TODO : UI Confirm with Mr.Mo
  58. // [pvc presentViewController:vc animated:YES completion:nil];
  59. // }];
  60. }
  61. - (IBAction)btnCancelTouched:(id)sender {
  62. [[JDFacade facade] dismissModalStack:YES completion:^{
  63. [[JDFacade facade] gotoWishMenu:KNMenuIdThings];
  64. }];
  65. }
  66. #pragma mark - MemoryWarning
  67. - (void)didReceiveMemoryWarning
  68. {
  69. [super didReceiveMemoryWarning];
  70. // Dispose of any resources that can be recreated.
  71. }
  72. @end