//
//  HomeHubSecondStepViewController.m
//  kneet2
//
//  Created by Jason Lee on 10/22/15.
//  Copyright © 2015 ntels. All rights reserved.
//

#import "HomeHubSecondStepViewController.h"


@interface HomeHubSecondStepViewController () {

}
@end


#pragma mark - Class Definition

@implementation HomeHubSecondStepViewController


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

- (void)viewDidAppear:(BOOL)animated {
    [super viewDidAppear:animated];
    
    [UIView animateWithDuration:kfAnimationDur animations:^{
        _maskView.alpha = 0.7;
    } completion:^(BOOL finished) {
        
        _constraintPopViewTop.constant = 64;
        
        [UIView animateWithDuration:kfAnimationDur animations:^{
            [self.view layoutIfNeeded];
        }];
    }];
}


- (void)initUI {
    
}

- (void)prepareViewDidLoad {
    
}

#pragma mark - Main Logic



#pragma mark - UI Events
- (IBAction)btnPrevTouched:(id)sender {
    [UIView animateWithDuration:kfAnimationDur animations:^{
        _maskView.alpha = 0.0;
    } completion:^(BOOL finished) {
        [self dismissViewControllerAnimated:YES completion:nil];
    }];
}


- (IBAction)btnNextTouched:(id)sender {
    UIViewController *vc = [CommonUtil instantiateViewControllerWithIdentifier:@"HomeHubThirdStepViewController" storyboardName:@"HomeHub"];
    
    vc.providesPresentationContextTransitionStyle = YES;
    vc.definesPresentationContext = YES;
    
    [vc setModalPresentationStyle:UIModalPresentationOverCurrentContext];
    
    [self presentViewController:vc animated:nil completion:nil];
    
}

- (IBAction)btnCloseTouched:(id)sender {
    [[JDFacade facade] dismissModalStack:YES completion:nil];
}


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

@end