SignUpCompleteViewController.m 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. //
  2. // SignUpCompleteViewController.m
  3. // kneet
  4. //
  5. // Created by Jason Lee on 4/27/15.
  6. // Copyright (c) 2015 ntels. All rights reserved.
  7. //
  8. #import "JDObject.h"
  9. #import "CustomLabel.h"
  10. #import "SignUpCompleteViewController.h"
  11. #import "ThingsAddViewController.h"
  12. #import "CustomButton.h"
  13. @interface SignUpCompleteViewController () {
  14. ThingsAddViewController *_tvc;
  15. }
  16. @end
  17. #pragma mark - Class Definition
  18. @implementation SignUpCompleteViewController
  19. - (void)viewDidLoad {
  20. [super viewDidLoad];
  21. // Do any additional setup after loading the view.
  22. [self initUI];
  23. [self prepareViewDidLoad];
  24. }
  25. - (void)initUI {
  26. _scrollView.translatesAutoresizingMaskIntoConstraints = NO;
  27. //Localization
  28. _lblTitle.text = NSLocalizedString(@"장치 연결을 시작합니다", @"장치 연결을 시작합니다");
  29. [_btnRegisterLater setTitle:NSLocalizedString(@"나중에 등록하기", @"나중에 등록하기") forState:UIControlStateNormal];
  30. }
  31. - (void)prepareViewDidLoad {
  32. _lblHomeDesc.text = [NSString stringWithFormat:NSLocalizedString(@"%@이 만들어졌습니다\n장치를 연결해서 시작해보세요!", @"%@이 만들어졌습니다\n장치를 연결해서 시작해보세요!"), [JDFacade facade].tmpHomegrpName];
  33. _tvc = (ThingsAddViewController *)[CommonUtil instantiateViewControllerWithIdentifier:@"ThingsAddViewController" storyboardName:@"Things"];
  34. [self addChildViewController:_tvc];
  35. [_tvc didMoveToParentViewController:self];
  36. if ([self isViewLoaded]) {
  37. [_tvc beginAppearanceTransition:YES animated:NO];
  38. [_childContainerView addSubview:_tvc.view];
  39. _tvc.tableView.scrollEnabled = NO;
  40. [_tvc endAppearanceTransition];
  41. _constraintChildContainerViewHeight.constant = _constraintChildContainerViewHeight.constant * 5;//[_tvc.tableView numberOfRowsInSection:0];
  42. CGFloat contentHeight = 290 + _constraintChildContainerViewHeight.constant + 30 + 40 + 30;
  43. [_tvc.view mas_makeConstraints:^(MASConstraintMaker *make) {
  44. make.size.mas_equalTo(_childContainerView);
  45. make.center.equalTo(_childContainerView);
  46. }];
  47. [self.view layoutIfNeeded];
  48. [_scrollView setContentSize:CGSizeMake(IPHONE_WIDTH, contentHeight)];
  49. }
  50. }
  51. #pragma mark - Main Logic
  52. #pragma mark - UI Events
  53. - (IBAction)bannerWallPadTouched:(id)sender
  54. {
  55. UIViewController *vc = [CommonUtil instantiateViewControllerWithIdentifier:@"ThingsAddWallpadViewController" storyboardName:@"Things"];
  56. UINavigationController *nc = [[UINavigationController alloc] init];
  57. nc.viewControllers = @[vc];
  58. [[JDFacade facade] presentViewControllerByPush:nc pvc:self];
  59. }
  60. - (IBAction)bannerWallPadSubTouched:(id)sender
  61. {
  62. //1. 등록된 월패드가 있는 지 체크
  63. UIViewController *vc = [CommonUtil instantiateViewControllerWithIdentifier:@"ThingsAddWallpadSubViewController" storyboardName:@"Things"];
  64. UINavigationController *nc = [[UINavigationController alloc] init];
  65. nc.viewControllers = @[vc];
  66. [[JDFacade facade] presentViewControllerByPush:nc pvc:self];
  67. }
  68. - (IBAction)bannerDawonTouched:(id)sender
  69. {
  70. UIViewController *vc = [CommonUtil instantiateViewControllerWithIdentifier:@"ThingsAddPlugViewController" storyboardName:@"Things"];
  71. UINavigationController *nc = [[UINavigationController alloc] init];
  72. nc.viewControllers = @[vc];
  73. [[JDFacade facade] presentViewControllerByPush:nc pvc:self];
  74. }
  75. - (IBAction)bannerLiveCamTouched:(id)sender
  76. {
  77. UIViewController *vc = [CommonUtil instantiateViewControllerWithIdentifier:@"ThingsAddCameraViewController" storyboardName:@"Things"];
  78. UINavigationController *nc = [[UINavigationController alloc] init];
  79. nc.viewControllers = @[vc];
  80. [[JDFacade facade] presentViewControllerByPush:nc pvc:self];
  81. }
  82. - (IBAction)bannerPhoneTouched:(id)sender {
  83. // if ([JDFacade facade].loginHomeGroup.deviceId && ![[JDFacade facade].loginHomeGroup.deviceId isEmptyString]) {
  84. // [[JDFacade facade] alert:NSLocalizedString(@"이미 등록하셨습니다", @"이미 등록하셨습니다")];
  85. // return;
  86. // }
  87. UIViewController *vc = [CommonUtil instantiateViewControllerWithIdentifier:@"ThingsAddGeofencingViewController" storyboardName:@"Things"];
  88. UINavigationController *nc = [[UINavigationController alloc] init];
  89. nc.viewControllers = @[vc];
  90. [[JDFacade facade] presentViewControllerByPush:nc pvc:self];
  91. }
  92. - (IBAction)btnRegisterLaterTouched:(id)sender {
  93. UIViewController *rvc = [JDFacade facade].appDelegate.window.rootViewController;
  94. if (rvc.presentedViewController || (rvc.presentingViewController && (rvc.modalPresentationStyle == UIModalPresentationFullScreen))){
  95. [rvc dismissViewControllerAnimated:NO completion:nil];
  96. }
  97. UIViewController *vc = [CommonUtil instantiateViewControllerWithIdentifier:@"DashboardViewController" storyboardName:@"Main"];
  98. UINavigationController *nc = [[UINavigationController alloc] init];
  99. nc.viewControllers = @[vc];
  100. [JDFacade facade].appDelegate.window.rootViewController = nc;
  101. }
  102. #pragma mark - MemoryWarning
  103. - (void)didReceiveMemoryWarning
  104. {
  105. [super didReceiveMemoryWarning];
  106. // Dispose of any resources that can be recreated.
  107. }
  108. @end