//
//  ScenesRegisterTitleViewController.m
//  kneet
//
//  Created by Jason Lee on 4/1/15.
//  Copyright (c) 2015 ntels. All rights reserved.
//
#import "SceneModel.h"

#import "CustomTextField.h"
#import "ValidateUtil.h"
#import "ScenesRegisterViewController.h"

#import "ScenesRegisterTitleViewController.h"


@interface ScenesRegisterTitleViewController () {

}
@end


#pragma mark - Class Definition

@implementation ScenesRegisterTitleViewController


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

    [self initUI];
    [self prepareViewDidLoad];
}


- (void)initUI {
    self.title = @"Write the Scene's name";

    _txtSceneName.keyboardType = UIKeyboardTypeDefault;
    _txtSceneName.returnKeyType = UIReturnKeyDone;
    _txtSceneName.text = _predefinedScene.sceneName;

    
}

- (void)prepareViewDidLoad {

}

#pragma mark - Main Logic



#pragma mark - UI Events
- (IBAction)btnNextTouched:(id)sender {

    if (![ValidateUtil validateTextfiled:_txtSceneName type:ValidateTypeNull title:@"Scene's title"]) {
        return;
    }

    _predefinedScene.sceneName = _txtSceneName.text;


    ScenesRegisterViewController *vc = (ScenesRegisterViewController *)[CommonUtil instantiateViewControllerWithIdentifier:@"ScenesRegisterViewController" storyboardName:@"Scenes"];
    vc.tmpPredScene = _predefinedScene;

    [self.navigationController pushViewController:vc animated:YES];
}

- (IBAction)btnCancelTouched:(id)sender {
    [self.navigationController popViewControllerAnimated:YES];
}



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

@end
