-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFirstView.m
More file actions
59 lines (50 loc) · 1.31 KB
/
FirstView.m
File metadata and controls
59 lines (50 loc) · 1.31 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
50
51
52
53
54
55
56
57
58
59
//
// FirstView.m
// iCongress
//
// Created by Robert Gordan on 11/20/14.
// Copyright (c) 2014 Holworthy17. All rights reserved.
//
#import "FirstView.h"
@implementation FirstView
NSString* address;
NSString* city;
NSString* state;
NSString* zip;
-(void)viewDidLoad
{
self.navigationItem.title = @"iCongress";
}
-(void)textFieldDidEndEditing:(UITextField *)textField
{
//assign input for address
if([textField.placeholder isEqualToString:@"Address"])
{
address = textField.text;
NSLog(@"address: %@\n", address);
}
else if([textField.placeholder isEqualToString:@"City"])
{
city = textField.text;
}
else if([textField.placeholder isEqualToString:@"State"])
{
state = textField.text;
}
else if([textField.placeholder isEqualToString:@"Zip"])
{
zip = textField.text;
}
}
-(IBAction)addressLookup:(id)sender
{
NSString* combined = [NSString stringWithFormat:@"%@ @ %@ %@", address, city, state, zip];
CLGeocoder* geocoder = [[CLGeocoder alloc] init];
[geocoder geocodeAddressString:combined completionHandler:^(NSArray* placemarks, NSError* error){
}];
[self performSegueWithIdentifier:@"toReps" sender:self];
}
-(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
}
@end