ThingsAddCompleteViewController.m 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. //
  2. // ThingsAddCompleteViewController.m
  3. //
  4. //
  5. // Created by Jason Lee on 11/13/15.
  6. //
  7. //
  8. #import "ThingsAddCompleteViewController.h"
  9. #import "ChangeDeviceNamePopupView.h"
  10. @interface ThingsAddCompleteViewController () {
  11. }
  12. @end
  13. #pragma mark - Class Definition
  14. @implementation ThingsAddCompleteViewController
  15. @synthesize deviceDetailModel;
  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. _btnChange.enabled = NO;
  24. if (_isDeleteMode) {
  25. _lblTitle.text = @"삭제 성공";
  26. _lblDesc.text = @"장치를 삭제했습니다";
  27. }
  28. }
  29. - (void)viewDidAppear:(BOOL)animated {
  30. [super viewDidAppear:animated];
  31. [UIView animateWithDuration:kfAnimationDur animations:^{
  32. _maskView.alpha = 0.7;
  33. } completion:^(BOOL finished) {
  34. _constraintPopViewTop.constant = (IPHONE_HEIGHT - _popView.height) / 2;
  35. [UIView animateWithDuration:kfAnimationDur animations:^{
  36. [self.view layoutIfNeeded];
  37. }];
  38. }];
  39. }
  40. - (void)prepareViewDidLoad {
  41. }
  42. #pragma mark - Main Logic
  43. #pragma mark - UI Events
  44. // 나중에 변경
  45. - (IBAction)btnCompleteTouched:(id)sender {
  46. [[JDFacade facade] dismissModalStack:YES completion:^{
  47. [[JDFacade facade] gotoWishMenu:KNMenuIdThings];
  48. }];
  49. }
  50. // 이름 변경
  51. - (IBAction)btnChangeTouched:(id)sender {
  52. ChangeDeviceNamePopupView *popup = [[ChangeDeviceNamePopupView alloc]initFromNib:deviceDetailModel];
  53. popup.deviceDetailModel = deviceDetailModel;
  54. [popup show];
  55. }
  56. -(void)receiveSocketData:(NSNotification *)notification
  57. {
  58. _btnChange.enabled = YES;
  59. deviceDetailModel = [[DeviceDetailModel alloc] initWithDictionary:notification.object error:nil];
  60. }
  61. #pragma mark - MemoryWarning
  62. - (void)didReceiveMemoryWarning
  63. {
  64. [super didReceiveMemoryWarning];
  65. // Dispose of any resources that can be recreated.
  66. }
  67. @end