| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129 |
- //
- // ThingsAddCompleteViewController.m
- // kneet
- //
- // Created by Jason Lee on 5/26/15.
- // Copyright (c) 2015 ntels. All rights reserved.
- //
- #import "JDObject.h"
- #import "ThingsAddCompleteViewController.h"
- #import "ThingsAddViewController.h"
- #import "QRCodeViewController.h"
- #import "SignUpCompleteViewController.h"
- #import "HomeLocationViewController.h"
- #import "StartHomeViewController.h"
- #import "ThingsViewController.h"
- #import "CustomLabel.h"
- #import "CustomButton.h"
- #import "ThingsAddWallpadSubViewController.h"
- #import "ThingsAddWallpadViewController.h"
- @interface ThingsAddCompleteViewController () {
- }
- @end
- #pragma mark - Class Definition
- @implementation ThingsAddCompleteViewController
- - (void)viewDidLoad {
- [super viewDidLoad];
- // Do any additional setup after loading the view.
- [self initUI];
- [self prepareViewDidLoad];
- }
- - (void)initUI {
-
- if (IPHONE_HEIGHT == 460.0f) {
- _constraintImgvAvatarTop.constant -= 75.0f;
- }
-
- _lblTitle.text = NSLocalizedString(@"축하합니다!", @"축하합니다!");
- _lblDesc.text = NSLocalizedString(@"이제부터 '내 장치' 메뉴에서\n사용할 수 있습니다", @"이제부터 '내 장치' 메뉴에서\n사용할 수 있습니다");
-
- [_btnNext setTitle:NSLocalizedString(@"보러가기", @"보러가기") forState:UIControlStateNormal];
- [_btnAddMore setTitle:NSLocalizedString(@"장치 추가", @"장치 추가") forState:UIControlStateNormal];
- }
- - (void)prepareViewDidLoad {
- }
- #pragma mark - Main Logic
- #pragma mark - UI Events
- - (IBAction)btnNextTouched:(id)sender {
- [[JDFacade facade] gotoWishMenu:KNMenuIdThings]; //장치리스트로 이동.
- }
- - (IBAction)btnAddMoreTouched:(id)sender {
- ThingsViewController *tvc = [[JDFacade facade] viewControllerOnNaviationController:[ThingsViewController class]];
- if (tvc) {//장치 리스트를 갱신함.
- [tvc prepareViewDidLoad];
- }
- if ([self.presentingViewController.presentingViewController isKindOfClass:[QRCodeViewController class]]) {//QR코드로 등록한 경우,
- UIViewController *vc = self.presentingViewController.presentingViewController.presentingViewController.presentingViewController; //signup Complete
- if (vc) {//회원가입
- [[JDFacade facade] dismissViewControllerByPush:vc];
-
- } else {//디바이스 메뉴
- vc = self.presentingViewController.presentingViewController.presentingViewController;
- [[JDFacade facade] dismissViewControllerByPush:vc completion:^{
- ThingsAddViewController *vc = [[JDFacade facade] viewControllerOnNaviationController:[ThingsAddViewController class]];
- [[JDFacade facade].currentViewController.navigationController popToViewController:vc animated:NO];
- }];
- }
- } else {//cam, smartphone, wallpadsubtype
- if (self.presentingViewController.presentingViewController) {//회원가입, 디바이스 메뉴 - 월패드 하위디바이스
- UIViewController *vc = self.presentingViewController.presentingViewController; //signup Complete
-
- BOOL isWallpadSub = NO;
- if ([vc isKindOfClass:[UINavigationController class]]) {
- UINavigationController *nc = (UINavigationController *)vc;
- isWallpadSub = [nc.viewControllers.firstObject isKindOfClass:[ThingsAddWallpadSubViewController class]];
- }
-
- [[JDFacade facade] dismissViewControllerByPush:vc completion:^{
-
- if (tvc) {//월패드 하위 디바이스
- ThingsAddViewController *vc = [[JDFacade facade] viewControllerOnNaviationController:[ThingsAddViewController class]];
- [[JDFacade facade].currentViewController.navigationController popToViewController:vc animated:NO];
- } else if (isWallpadSub) {
- UIViewController *pvc = [JDFacade facade].currentViewController.presentedViewController.presentedViewController.presentedViewController;
- [pvc dismissViewControllerAnimated:NO completion:nil];
- }
- }];
- } else {//디바이스 메뉴
- [[JDFacade facade] dismissViewControllerByPush:self completion:^{
- ThingsAddViewController *vc = [[JDFacade facade] viewControllerOnNaviationController:[ThingsAddViewController class]];
- [[JDFacade facade].currentViewController.navigationController popToViewController:vc animated:NO];
- }];
- }
- }
- }
- #pragma mark - MemoryWarning
- - (void)didReceiveMemoryWarning
- {
- [super didReceiveMemoryWarning];
- // Dispose of any resources that can be recreated.
- }
- @end
|