HomeHubUpdateCompleteViewController.m 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. //
  2. // HomeHubUpdateCompleteViewController.m
  3. // OneCable
  4. //
  5. // Created by nComz on 2017. 5. 11..
  6. // Copyright © 2017년 ntels. All rights reserved.
  7. //
  8. #import "HomeHubUpdateCompleteViewController.h"
  9. #import "MultiHomeHubViewController.h"
  10. #import "HomeHubUpdateGuideViewController.h"
  11. #import "RequestHandler.h"
  12. @interface HomeHubUpdateCompleteViewController ()
  13. @property (weak, nonatomic) IBOutlet UILabel *lbContent;
  14. @end
  15. @implementation HomeHubUpdateCompleteViewController
  16. - (void)viewDidLoad {
  17. [super viewDidLoad];
  18. [self initUI];
  19. [self prepareViewDidLoad];
  20. }
  21. - (void)initUI {
  22. if (!_isUpdate) {
  23. BLEServiceHandler *bleService = [BLEServiceHandler sharedManager];
  24. if ( [bleService isConnected] &&
  25. bleService.conDevice != nil &&
  26. !EQUALS([bleService getValueFromCharacteristic:kBLEChrRdSSID], @"-") ) {
  27. _lbContent.text = [NSString stringWithFormat:@"홈허브가 %@에 연결되었습니다.", [bleService getValueFromCharacteristic:kBLEChrRdSSID]];
  28. }
  29. }
  30. }
  31. - (void)prepareViewDidLoad {
  32. }
  33. - (void)didReceiveMemoryWarning {
  34. [super didReceiveMemoryWarning];
  35. }
  36. - (IBAction)btnConfirmTouched:(id)sender {
  37. // UIViewController *vc = vc = [CommonUtil instantiateViewControllerWithIdentifier:@"HomeHubViewController" storyboardName:@"Main"];
  38. //
  39. // //멀티 홈허브일때
  40. // if ([[JDFacade facade].loginUser isMultiHomeHub]) {
  41. //
  42. // vc = [CommonUtil instantiateViewControllerWithIdentifier:@"MultiHomeHubViewController" storyboardName:@"Main"];
  43. // }
  44. //
  45. NSArray *vcs = self.navigationController.viewControllers;
  46. MultiHomeHubViewController *vc = (MultiHomeHubViewController*)[vcs objectAtIndex:0];
  47. NSLog(@"update Complite vc 0 : %@", vc);
  48. [self.navigationController popToRootViewControllerAnimated:YES completion:^{
  49. if (_isUpdate && ([vc isKindOfClass:MultiHomeHubViewController.class] || [vc isKindOfClass:HomeHubUpdateGuideViewController.class])) {
  50. [vc operationComplite];
  51. }
  52. }];
  53. }
  54. @end