RulesRegisterTitleViewController.m 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. //
  2. // RulesRegisterTitleViewController.m
  3. // kneet
  4. //
  5. // Created by Jason Lee on 3/19/15.
  6. // Copyright (c) 2015 ntels. All rights reserved.
  7. //
  8. #import "RulesRegisterTitleViewController.h"
  9. #import "CustomTextField.h"
  10. #import "RuleModel.h"
  11. #import "ValidateUtil.h"
  12. #import "RulesRegisterViewController.h"
  13. @interface RulesRegisterTitleViewController () {
  14. NSInteger _rowCount;
  15. }
  16. @end
  17. #pragma mark - Class Definition
  18. @implementation RulesRegisterTitleViewController
  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. self.title = @"Write the Rule's name";
  27. _txtRuleName.keyboardType = UIKeyboardTypeDefault;
  28. _txtRuleName.returnKeyType = UIReturnKeyDone;
  29. _txtRuleName.text = _predefinedRule.ruleName;
  30. }
  31. - (void)prepareViewDidLoad {
  32. _rowCount = 5;
  33. }
  34. #pragma mark - Main Logic
  35. #pragma mark - UITableView Delegate
  36. - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
  37. return _rowCount;
  38. }
  39. #pragma mark - UI Events
  40. - (IBAction)btnNextTouched:(id)sender {
  41. if (![ValidateUtil validateTextfiled:_txtRuleName type:ValidateTypeNull title:@"규칙이름"]) {
  42. return;
  43. }
  44. _predefinedRule.ruleName = _txtRuleName.text;
  45. RulesRegisterViewController *vc = (RulesRegisterViewController *)[CommonUtil instantiateViewControllerWithIdentifier:@"RulesRegisterViewController" storyboardName:@"Rules"];
  46. vc.tmpPredRule = _predefinedRule;
  47. [self.navigationController pushViewController:vc animated:YES];
  48. }
  49. - (IBAction)btnCancelTouched:(id)sender {
  50. [self.navigationController popViewControllerAnimated:YES];
  51. }
  52. #pragma mark - MemoryWarning
  53. - (void)didReceiveMemoryWarning
  54. {
  55. [super didReceiveMemoryWarning];
  56. // Dispose of any resources that can be recreated.
  57. }
  58. @end