forked from hzalaz/SSNTextFieldManager
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathViewController.m
More file actions
49 lines (37 loc) · 1.12 KB
/
Copy pathViewController.m
File metadata and controls
49 lines (37 loc) · 1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
//
// ViewController.m
// SSNTextFieldExample
//
// Created by Nicolas Purita on 8/15/14.
// Copyright (c) 2014 NicoPuri. All rights reserved.
//
#import "ViewController.h"
#import "SSNTextFieldDelegate.h"
#import "SSN.h"
@interface ViewController ()
@end
@implementation ViewController
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
}
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
[self.textField becomeFirstResponder];
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
- (IBAction)checkSSN:(id)sender {
SSN *ssn = [self.textFieldDelegate getSSN];
NSMutableString *result = [[NSMutableString alloc] init];
[result appendFormat:@"Area Number: %@\n", ssn.areaNumber];
[result appendFormat:@"Group Code: %@\n", ssn.groupCode];
[result appendFormat:@"Serial Number: %@\n", ssn.serialNumber];
[result appendFormat:@"Valid: %@\n", [ssn isValid] ? @"TRUE" : @"FALSE"];
self.result.text = result;
}
@end