//
//  WelcomeViewController.m
//  SmartCity
//
//  Created by Jason Lee on 1/12/16.
//  Copyright © 2016 ntels. All rights reserved.
//

#import "CustomLabel.h"
#import "LoginViewController.h"

#import "WelcomeViewController.h"

@interface WelcomeViewController () {

}
@end


#pragma mark - Class Definition

@implementation WelcomeViewController


- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    [self initUI];
    [self prepareViewDidLoad];
}


- (void)initUI {
    
    [_lblStart setUnderLine:_lblStart.text];
    [_lblStart addTouchEventHandler:^(id label) {
        [self lblStartTouched];
    }];
}

- (void)prepareViewDidLoad {
    
}

#pragma mark - Main Logic



#pragma mark - UI Events
- (void)lblStartTouched {
    
    [[JDFacade facade] updateLoginInfo:^{
        
        LoginViewController *lvc = [[JDFacade facade] viewControllerOnPresentingViewController:self viewControllerClass:[LoginViewController class]];
        if ([lvc isKindOfClass:[LoginViewController class]]) {
            [lvc actionAfterInvitaion];
            
            [self dismissViewControllerAnimated:YES completion:nil];
        } else {
            //메인으로 이동
            [[JDFacade facade] gotoWishMenu:KNMenuIdThings];
        }
    }];
}


#pragma mark - MemoryWarning
- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}



@end