ThingsForcedDelCompleteViewController.m 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. //
  2. // ThingsDelPlugCompleteViewController.m
  3. // OneCable
  4. //
  5. // Created by nComz on 2017. 3. 21..
  6. // Copyright © 2017년 ntels. All rights reserved.
  7. //
  8. #import "JDObject.h"
  9. #import "ThingsForcedDelCompleteViewController.h"
  10. #import "CustomLabel.h"
  11. #import "CustomButton.h"
  12. #import "CustomImageView.h"
  13. #import "MainViewController.h"
  14. #import "ThingsViewController.h"
  15. #import "ThingsDetailViewController.h"
  16. @interface ThingsForcedDelCompleteViewController ()
  17. @end
  18. @implementation ThingsForcedDelCompleteViewController
  19. - (void)viewDidLoad {
  20. [super viewDidLoad];
  21. [self initUI];
  22. [self prepareViewDidLoad];
  23. }
  24. - (void)initUI {
  25. }
  26. - (void)prepareViewDidLoad {
  27. NSMutableString *title = [NSMutableString stringWithString:_delDevice.prdName];
  28. [title appendString:@" 삭제"];
  29. _imgThings.image = [_delDevice imgaeForAddDel];
  30. _lblManufacturer.text = [_delDevice manufacturerName];
  31. _imgThingsSuccess.hidden = !_isSuccess;
  32. _imgThingsFail.hidden = _isSuccess;
  33. if (_isSuccess) {
  34. [title appendString:@" 성공"];
  35. } else {
  36. [title appendString:@" 실패"];
  37. }
  38. _lblTitle.text = title;
  39. }
  40. - (void)didReceiveMemoryWarning {
  41. [super didReceiveMemoryWarning];
  42. }
  43. - (IBAction)btnConfirmTouched:(id)sender {
  44. [self dismissViewControllerAnimated:YES completion:^{
  45. // ThingsViewController *vc = [JDFacade facade].mainViewController.tvc;
  46. //
  47. // if (vc && [vc isKindOfClass:[ThingsViewController class]]) {
  48. // [vc finishDeviveDelete];
  49. // } else {
  50. // ThingsDetailViewController *vc2 = (ThingsDetailViewController *)vc;
  51. // [vc2 finishDeviveDelete];
  52. // }
  53. ThingsDetailViewController *vc = (ThingsDetailViewController*)[JDFacade facade].currentViewController;
  54. if (vc && [vc isKindOfClass:[ThingsDetailViewController class]]) {
  55. [vc finishDeviveDelete];
  56. } else {
  57. ThingsViewController *vc2 = [JDFacade facade].mainViewController.tvc;
  58. [vc2 finishDeviveDelete];
  59. }
  60. }];
  61. }
  62. @end