ThingsAddCompleteViewController.m 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  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. _lblTitle.text = [NSString stringWithFormat:@"%@ 추가 완료", _addDevice.prdName];
  25. _imgThings.image = [_addDevice imgaeForAddDel];
  26. _lblDesc.text = [_addDevice manufacturerName];
  27. if (_isDeleteMode) {
  28. _lblTitle.text = @"삭제 성공";
  29. _lblDesc.text = @"장치를 삭제했습니다";
  30. }
  31. }
  32. - (void)viewDidAppear:(BOOL)animated {
  33. [super viewDidAppear:animated];
  34. [UIView animateWithDuration:kfAnimationDur animations:^{
  35. _maskView.alpha = 0.7;
  36. } completion:^(BOOL finished) {
  37. _constraintPopViewTop.constant = (IPHONE_HEIGHT - _popView.height) / 2;
  38. [UIView animateWithDuration:kfAnimationDur animations:^{
  39. [self.view layoutIfNeeded];
  40. }];
  41. }];
  42. }
  43. - (void)prepareViewDidLoad {
  44. }
  45. #pragma mark - UI Events
  46. // 나중에 변경
  47. - (IBAction)btnCompleteTouched:(id)sender {
  48. [[JDFacade facade] dismissModalStack:YES completion:^{
  49. [[JDFacade facade] gotoWishMenu:KNMenuIdThings];
  50. }];
  51. }
  52. // 이름 변경
  53. - (IBAction)btnChangeTouched:(id)sender {
  54. ChangeDeviceNamePopupView *popup = [[ChangeDeviceNamePopupView alloc]initFromNib:_deviceDetailModel];
  55. popup.deviceDetailModel = _deviceDetailModel;
  56. popup.delegate = self;
  57. [popup show];
  58. }
  59. - (void)changeDeviceName:(NSString *)deviceName {
  60. [self btnCompleteTouched:nil];
  61. }
  62. -(void)receiveSocketData:(NSNotification *)notification
  63. {
  64. _btnChange.enabled = YES;
  65. // deviceDetailModel = [[DeviceDetailModel alloc] initWithDictionary:notification.object error:nil];
  66. }
  67. #pragma mark - MemoryWarning
  68. - (void)didReceiveMemoryWarning
  69. {
  70. [super didReceiveMemoryWarning];
  71. // Dispose of any resources that can be recreated.
  72. }
  73. @end