ThingsAddCompleteViewController.m 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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 - 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 show];
  54. }
  55. -(void)receiveSocketData:(NSNotification *)notification
  56. {
  57. _btnChange.enabled = YES;
  58. deviceDetailModel = [[DeviceDetailModel alloc] initWithDictionary:notification.object error:nil];
  59. }
  60. #pragma mark - MemoryWarning
  61. - (void)didReceiveMemoryWarning
  62. {
  63. [super didReceiveMemoryWarning];
  64. // Dispose of any resources that can be recreated.
  65. }
  66. @end