ThingsAddPlugViewController.m 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. //
  2. // ThingsAddPlugViewController.m
  3. // kneet
  4. //
  5. // Created by Jason Lee on 5/27/15.
  6. // Copyright (c) 2015 ntels. All rights reserved.
  7. //
  8. #import "ThingsAddPlugViewController.h"
  9. #import "JDObject.h"
  10. #import "QRCodeViewController.h"
  11. #import "CustomLabel.h"
  12. #import "CustomButton.h"
  13. @interface ThingsAddPlugViewController () {
  14. }
  15. @end
  16. #pragma mark - Class Definition
  17. @implementation ThingsAddPlugViewController
  18. - (void)viewDidLoad {
  19. [super viewDidLoad];
  20. // Do any additional setup after loading the view.
  21. [self initUI];
  22. [self prepareViewDidLoad];
  23. }
  24. - (void)viewWillAppear:(BOOL)animated {
  25. [super viewWillAppear:animated];
  26. self.title = NSLocalizedString(@"새 장치 추가",nil);
  27. }
  28. - (void)initUI {
  29. //set tableview option
  30. self.tableView.delegate = self;
  31. self.tableView.dataSource = self;
  32. self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
  33. self.tableView.backgroundColor = [UIColor clearColor];
  34. self.tableView.tableFooterView = [[UIView alloc] init]; //this call table events;
  35. //Localization
  36. _lblTitle.text = NSLocalizedString(@"DAWON 스마트플러그를 현재 홈에 등록합니다", @"DAWON 스마트플러그를 현재 홈에 등록합니다");
  37. _lblStep1Title.text = NSLocalizedString(@"다원플러그 app을 통해 플러그를 WIFI에 연결하세요", @"다원플러그 app을 통해 플러그를 WIFI에 연결하세요");
  38. _lblStep2Title.text = NSLocalizedString(@"WIFI에 연결된 플러그의 화면을 통해 AoTHome 등록 완료를 확인하세요", @"WIFI에 연결된 플러그의 화면을 통해 AoTHome 등록 완료를 확인하세요");
  39. _lblStep3Title.text= NSLocalizedString(@"플러그에 부착된 QR 코드를 촬영하세요", @"플러그에 부착된 QR 코드를 촬영하세요");
  40. [_btnQRCode setTitle:NSLocalizedString(@"QR코드 촬영", @"QR코드 촬영") forState:UIControlStateNormal];
  41. }
  42. - (void)prepareViewDidLoad {
  43. }
  44. #pragma mark - Main Logic
  45. #pragma mark - UI Events
  46. - (IBAction)btnDawonLinkTouched:(id)sender {
  47. [[UIApplication sharedApplication] openURL:[NSURL URLWithString:URL_DAWON_UPDATE]];
  48. }
  49. - (IBAction)btnQRCodeTouched:(id)sender {
  50. QRCodeViewController *vc = (QRCodeViewController *)[CommonUtil instantiateViewControllerWithIdentifier:@"QRCodeViewController" storyboardName:@"Things"];
  51. vc.qrcodeType = QRCodeTypeDawonSmartPlug;
  52. [[JDFacade facade] presentViewControllerByPush:vc pvc:self];
  53. }
  54. #pragma mark - MemoryWarning
  55. - (void)didReceiveMemoryWarning
  56. {
  57. [super didReceiveMemoryWarning];
  58. // Dispose of any resources that can be recreated.
  59. }
  60. @end