forked from calabash/calabash-ios-example
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLPFirstViewController.m
64 lines (53 loc) · 1.44 KB
/
LPFirstViewController.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
//
// LPFirstViewController.m
// LPSimpleExample
//
// Created by Karl Krukow on 07/10/11.
// Copyright (c) 2011 Trifork. All rights reserved.
//
#import "LPFirstViewController.h"
@implementation LPFirstViewController
@synthesize button;
@synthesize uiswitch;
@synthesize segControl;
@synthesize textField;
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
self.title = NSLocalizedString(@"First", @"First");
self.tabBarItem.image = [UIImage imageNamed:@"first"];
}
return self;
}
-(void) viewDidLoad {
[super viewDidLoad];
self.uiswitch.isAccessibilityElement = YES;
self.uiswitch.accessibilityLabel = @"switch";
self.button.isAccessibilityElement = YES;
self.button.accessibilityLabel=@"login";
}
- (BOOL)textFieldShouldReturn:(UITextField *)_textField {
[_textField resignFirstResponder];
return YES;
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
// Return YES for supported orientations
return YES;
}
- (void)dealloc {
[textField release];
[segControl release];
[uiswitch release];
[button release];
[super dealloc];
}
- (void)viewDidUnload {
[self setTextField:nil];
[self setSegControl:nil];
[self setUiswitch:nil];
[self setButton:nil];
[super viewDidUnload];
}
@end