forked from chrisballinger/Cop-Recorder-iOS
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathACLUConfirmUpload.m
88 lines (65 loc) · 2.42 KB
/
ACLUConfirmUpload.m
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
//
// ACLUConfirmUpload.m
// CopRecorder
//
// Created by David Chiles on 5/25/12.
// Copyright (c) 2012 __MyCompanyName__. All rights reserved.
//
#import "ACLUConfirmUpload.h"
#import "ConfirmUploadInfoViewController.h"
@interface ACLUConfirmUpload ()
@end
@implementation ACLUConfirmUpload
@synthesize delegate;
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// Custom initialization
}
return self;
}
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view from its nib.
self.navigationItem.title = @"Confirm Upload";
UIButton* infoButton = [UIButton buttonWithType:UIButtonTypeInfoLight];
[infoButton addTarget:self action:@selector(infoButtonPressed:) forControlEvents:UIControlEventTouchUpInside];
UIBarButtonItem *modalButton = [[UIBarButtonItem alloc] initWithCustomView:infoButton];
[self.navigationItem setRightBarButtonItem:modalButton animated:YES];
UIBarButtonItem * cancelButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCancel target:self action:@selector(cancelButtonPressed:)];
[self.navigationItem setLeftBarButtonItem:cancelButton animated:YES];
//NSLog(@"%@",self.view.backgroundColor.description);
}
- (IBAction)yesButtonPressed:(id)sender
{
if(delegate)
[delegate uploadPressed];
[self.navigationController dismissModalViewControllerAnimated:YES];
}
- (IBAction)contactButtonPressed:(id)sender
{
NSURL *url = [ [ NSURL alloc ] initWithString: @"https://www.aclu-nj.org/yourrights/fileacomplaint/onlinecomplaint"];
[[UIApplication sharedApplication] openURL:url];
}
- (void)infoButtonPressed:(id)sender
{
ConfirmUploadInfoViewController * infoViewController = [[ConfirmUploadInfoViewController alloc] init];
[self.navigationController pushViewController:infoViewController animated:YES];
}
-(void)cancelButtonPressed:(id)sender
{
[self.navigationController dismissModalViewControllerAnimated:YES];
}
- (void)viewDidUnload
{
[super viewDidUnload];
// Release any retained subviews of the main view.
// e.g. self.myOutlet = nil;
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return (interfaceOrientation == UIInterfaceOrientationPortrait);
}
@end