ThingsAddFailViewController.m 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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. @interface ThingsAddFailViewController () {
  11. }
  12. @end
  13. #pragma mark - Class Definition
  14. @implementation ThingsAddFailViewController
  15. - (void)viewDidLoad {
  16. [super viewDidLoad];
  17. // Do any additional setup after loading the view.
  18. [self initUI];
  19. [self prepareViewDidLoad];
  20. }
  21. - (void)initUI {
  22. }
  23. - (void)viewDidAppear:(BOOL)animated {
  24. [super viewDidAppear:animated];
  25. [UIView animateWithDuration:kfAnimationDur animations:^{
  26. _maskView.alpha = 0.7;
  27. } completion:^(BOOL finished) {
  28. _constraintPopViewTop.constant = (IPHONE_HEIGHT - _popView.height) / 2;
  29. [UIView animateWithDuration:kfAnimationDur animations:^{
  30. [self.view layoutIfNeeded];
  31. }];
  32. }];
  33. }
  34. - (void)prepareViewDidLoad {
  35. }
  36. #pragma mark - Main Logic
  37. #pragma mark - UI Events
  38. - (IBAction)btnRetryTouched:(id)sender {
  39. if ([[JDFacade facade].loginUser.homehubOnlineState isEqualToString:@"OFF"]) {
  40. [[JDFacade facade] toast:@"홈허브가 온라인 상태로\r연결되어 있을 때 시도해주세요"];
  41. return;
  42. }
  43. ThingsAddIncludeViewController *vc = [CommonUtil instantiateViewControllerWithIdentifier:@"ThingsAddIncludeViewController" storyboardName:@"Things"];
  44. vc.addableDevice = _addableDevice;
  45. vc.providesPresentationContextTransitionStyle = YES;
  46. vc.definesPresentationContext = YES;
  47. [vc setModalPresentationStyle:UIModalPresentationOverCurrentContext];
  48. [self presentViewController:vc animated:YES completion:nil];
  49. }
  50. - (IBAction)btnCancelTouched:(id)sender {
  51. [[JDFacade facade] dismissModalStack:YES completion:^{
  52. [[JDFacade facade] gotoWishMenu:KNMenuIdThings];
  53. }];
  54. }
  55. #pragma mark - MemoryWarning
  56. - (void)didReceiveMemoryWarning
  57. {
  58. [super didReceiveMemoryWarning];
  59. // Dispose of any resources that can be recreated.
  60. }
  61. @end