ThingsAddCompleteViewController.m 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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. if (_isDeleteMode) {
  24. _lblTitle.text = @"삭제 성공";
  25. _lblDesc.text = @"장치를 삭제했습니다";
  26. }
  27. }
  28. - (void)viewDidAppear:(BOOL)animated {
  29. [super viewDidAppear:animated];
  30. [UIView animateWithDuration:kfAnimationDur animations:^{
  31. _maskView.alpha = 0.7;
  32. } completion:^(BOOL finished) {
  33. _constraintPopViewTop.constant = (IPHONE_HEIGHT - _popView.height) / 2;
  34. [UIView animateWithDuration:kfAnimationDur animations:^{
  35. [self.view layoutIfNeeded];
  36. }];
  37. }];
  38. }
  39. - (void)prepareViewDidLoad {
  40. }
  41. #pragma mark - Main Logic
  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. deviceDetailModel = [[DeviceDetailModel alloc] initWithDictionary:notification.object error:nil];
  58. }
  59. #pragma mark - MemoryWarning
  60. - (void)didReceiveMemoryWarning
  61. {
  62. [super didReceiveMemoryWarning];
  63. // Dispose of any resources that can be recreated.
  64. }
  65. @end