ThingsAddCompleteViewController.m 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  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 ()<changeDeviceNameDelegate> {
  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 - UI Events
  43. // 나중에 변경
  44. - (IBAction)btnCompleteTouched:(id)sender {
  45. [[JDFacade facade] dismissModalStack:YES completion:^{
  46. [[JDFacade facade] gotoWishMenu:KNMenuIdThings];
  47. }];
  48. }
  49. // 이름 변경
  50. - (IBAction)btnChangeTouched:(id)sender {
  51. ChangeDeviceNamePopupView *popup = [[ChangeDeviceNamePopupView alloc]initFromNib:_deviceDetailModel];
  52. popup.deviceDetailModel = _deviceDetailModel;
  53. popup.delegate = self;
  54. [popup show];
  55. }
  56. - (void)changeDeviceName:(NSString *)deviceName {
  57. [self btnCompleteTouched:nil];
  58. }
  59. -(void)receiveSocketData:(NSNotification *)notification
  60. {
  61. _btnChange.enabled = YES;
  62. // deviceDetailModel = [[DeviceDetailModel alloc] initWithDictionary:notification.object error:nil];
  63. }
  64. #pragma mark - MemoryWarning
  65. - (void)didReceiveMemoryWarning
  66. {
  67. [super didReceiveMemoryWarning];
  68. // Dispose of any resources that can be recreated.
  69. }
  70. @end