Ifd_Mobile 0.1.7 → 0.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/Ifd_Mobile/lib_steps.rb +145 -145
- data/lib/Ifd_Mobile/methods/IFD_Assertion.rb +44 -44
- data/lib/Ifd_Mobile/methods/IFD_Connection.rb +28 -0
- data/lib/Ifd_Mobile/methods/core.rb +256 -256
- data/lib/Ifd_Mobile/methods/database_methods.rb +25 -0
- data/lib/Ifd_Mobile/methods/lib_schema_data_steps.rb +53 -0
- data/lib/Ifd_Mobile/methods/lib_var.rb +53 -53
- data/lib/Ifd_Mobile/methods/required_files.rb +3 -0
- data/lib/Ifd_Mobile/version.rb +5 -5
- data/project/Gemfile +11 -9
- data/project/Gemfile.lock +137 -50
- data/project/apps/TestApp/Test App 2/GestureTestViewController.h +18 -18
- data/project/apps/TestApp/Test App 2/GestureTestViewController.m +48 -48
- data/project/apps/TestApp/Test App 2/GestureTestViewController.xib +46 -46
- data/project/apps/TestApp/Test App 2/MyViewControllerViewController.h +42 -42
- data/project/apps/TestApp/Test App 2/MyViewControllerViewController.m +193 -193
- data/project/apps/TestApp/Test App 2/TA2AppDelegate.h +28 -28
- data/project/apps/TestApp/Test App 2/TA2AppDelegate.m +85 -85
- data/project/apps/TestApp/Test App 2/TestApp-Info.plist +40 -40
- data/project/apps/TestApp/Test App 2/TestApp-Prefix.pch +29 -29
- data/project/apps/TestApp/Test App 2/en.lproj/InfoPlist.strings +21 -21
- data/project/apps/TestApp/Test App 2/en.lproj/MyViewControllerViewController.xib +175 -175
- data/project/apps/TestApp/Test App 2/main.m +31 -31
- data/project/apps/TestApp/TestApp.xcodeproj/project.pbxproj +336 -336
- data/project/apps/TestApp/TestApp.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -7
- data/project/apps/TestApp/TestApp.xcodeproj/xcuserdata/anhpham.xcuserdatad/xcschemes/TestApp.xcscheme +88 -88
- data/project/apps/TestApp/TestApp.xcodeproj/xcuserdata/anhpham.xcuserdatad/xcschemes/xcschememanagement.plist +22 -22
- data/project/features/TestData/SqlScript/test.sql +0 -0
- data/project/features/android/Android_test1.feature +14 -16
- data/project/features/android/Android_test2.feature +14 -14
- data/project/features/iOS/iOS_test.feature +15 -15
- data/project/features/step_definitions/lib_steps/PolyClaim_homepage.rb +2 -12
- data/project/features/step_definitions/lib_steps/PolyClaim_loginpage.rb +3 -3
- data/project/features/step_definitions/repositories/android_ob_test.rb +9 -9
- data/project/features/step_definitions/repositories/ios_ob_test.rb +6 -6
- data/project/features/support/env.rb +36 -36
- data/project/features/support/hooks.rb +8 -8
- data/project/features/support/project_env.rb +55 -42
- metadata +7 -5
- data/project/apps/Bedder_2.0_0.17_VN.apk +0 -0
- data/project/apps/polyclaim.apk +0 -0
@@ -1,42 +1,42 @@
|
|
1
|
-
/**
|
2
|
-
* Copyright 2012 Appium Committers
|
3
|
-
*
|
4
|
-
* Licensed to the Apache Software Foundation (ASF) under one
|
5
|
-
* or more contributor license agreements. See the NOTICE file
|
6
|
-
* distributed with this work for additional information
|
7
|
-
* regarding copyright ownership. The ASF licenses this file
|
8
|
-
* to you under the Apache License, Version 2.0 (the
|
9
|
-
* "License"); you may not use this file except in compliance
|
10
|
-
* with the License. You may obtain a copy of the License at
|
11
|
-
*
|
12
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
13
|
-
*
|
14
|
-
* Unless required by applicable law or agreed to in writing,
|
15
|
-
* software distributed under the License is distributed on an
|
16
|
-
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
17
|
-
* KIND, either express or implied. See the License for the
|
18
|
-
* specific language governing permissions and limitations
|
19
|
-
* under the License.
|
20
|
-
*/
|
21
|
-
|
22
|
-
#import <UIKit/UIKit.h>
|
23
|
-
#import <CoreLocation/CoreLocation.h>
|
24
|
-
#import "GestureTestViewController.h"
|
25
|
-
|
26
|
-
@interface MyViewControllerViewController : UIViewController <UITextFieldDelegate,CLLocationManagerDelegate>
|
27
|
-
@property (retain, nonatomic) IBOutlet UITextField *firstArg;
|
28
|
-
@property (retain, nonatomic) IBOutlet UITextField *secondArg;
|
29
|
-
@property (retain, nonatomic) IBOutlet UILabel *answerLabel;
|
30
|
-
@property (retain, nonatomic) IBOutlet UISwitch *locationStatus;
|
31
|
-
@property (retain, nonatomic) IBOutlet UIButton *computeSumButton;
|
32
|
-
@property (nonatomic, retain) CLLocationManager *locationMgr;
|
33
|
-
|
34
|
-
- (IBAction)testGesture:(id)sender;
|
35
|
-
- (IBAction)computeAction:(id)sender;
|
36
|
-
- (IBAction)showAlert:(id)sender;
|
37
|
-
- (IBAction)crashApp:(id)sender;
|
38
|
-
- (BOOL)textFieldShouldReturn:(UITextField *)textField;
|
39
|
-
- (void)logLocationAuthFromTimer:(NSTimer *)timer;
|
40
|
-
- (void)logLocationAuth;
|
41
|
-
|
42
|
-
@end
|
1
|
+
/**
|
2
|
+
* Copyright 2012 Appium Committers
|
3
|
+
*
|
4
|
+
* Licensed to the Apache Software Foundation (ASF) under one
|
5
|
+
* or more contributor license agreements. See the NOTICE file
|
6
|
+
* distributed with this work for additional information
|
7
|
+
* regarding copyright ownership. The ASF licenses this file
|
8
|
+
* to you under the Apache License, Version 2.0 (the
|
9
|
+
* "License"); you may not use this file except in compliance
|
10
|
+
* with the License. You may obtain a copy of the License at
|
11
|
+
*
|
12
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
13
|
+
*
|
14
|
+
* Unless required by applicable law or agreed to in writing,
|
15
|
+
* software distributed under the License is distributed on an
|
16
|
+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
17
|
+
* KIND, either express or implied. See the License for the
|
18
|
+
* specific language governing permissions and limitations
|
19
|
+
* under the License.
|
20
|
+
*/
|
21
|
+
|
22
|
+
#import <UIKit/UIKit.h>
|
23
|
+
#import <CoreLocation/CoreLocation.h>
|
24
|
+
#import "GestureTestViewController.h"
|
25
|
+
|
26
|
+
@interface MyViewControllerViewController : UIViewController <UITextFieldDelegate,CLLocationManagerDelegate>
|
27
|
+
@property (retain, nonatomic) IBOutlet UITextField *firstArg;
|
28
|
+
@property (retain, nonatomic) IBOutlet UITextField *secondArg;
|
29
|
+
@property (retain, nonatomic) IBOutlet UILabel *answerLabel;
|
30
|
+
@property (retain, nonatomic) IBOutlet UISwitch *locationStatus;
|
31
|
+
@property (retain, nonatomic) IBOutlet UIButton *computeSumButton;
|
32
|
+
@property (nonatomic, retain) CLLocationManager *locationMgr;
|
33
|
+
|
34
|
+
- (IBAction)testGesture:(id)sender;
|
35
|
+
- (IBAction)computeAction:(id)sender;
|
36
|
+
- (IBAction)showAlert:(id)sender;
|
37
|
+
- (IBAction)crashApp:(id)sender;
|
38
|
+
- (BOOL)textFieldShouldReturn:(UITextField *)textField;
|
39
|
+
- (void)logLocationAuthFromTimer:(NSTimer *)timer;
|
40
|
+
- (void)logLocationAuth;
|
41
|
+
|
42
|
+
@end
|
@@ -1,193 +1,193 @@
|
|
1
|
-
/**
|
2
|
-
* Copyright 2012 Appium Committers
|
3
|
-
*
|
4
|
-
* Licensed to the Apache Software Foundation (ASF) under one
|
5
|
-
* or more contributor license agreements. See the NOTICE file
|
6
|
-
* distributed with this work for additional information
|
7
|
-
* regarding copyright ownership. The ASF licenses this file
|
8
|
-
* to you under the Apache License, Version 2.0 (the
|
9
|
-
* "License"); you may not use this file except in compliance
|
10
|
-
* with the License. You may obtain a copy of the License at
|
11
|
-
*
|
12
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
13
|
-
*
|
14
|
-
* Unless required by applicable law or agreed to in writing,
|
15
|
-
* software distributed under the License is distributed on an
|
16
|
-
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
17
|
-
* KIND, either express or implied. See the License for the
|
18
|
-
* specific language governing permissions and limitations
|
19
|
-
* under the License.
|
20
|
-
*/
|
21
|
-
|
22
|
-
#import "MyViewControllerViewController.h"
|
23
|
-
#import <AddressBook/AddressBook.h>
|
24
|
-
#import <CoreLocation/CoreLocation.h>
|
25
|
-
|
26
|
-
@interface MyViewControllerViewController ()
|
27
|
-
|
28
|
-
@end
|
29
|
-
|
30
|
-
@implementation MyViewControllerViewController
|
31
|
-
@synthesize computeSumButton;
|
32
|
-
@synthesize answerLabel;
|
33
|
-
@synthesize firstArg;
|
34
|
-
@synthesize secondArg;
|
35
|
-
@synthesize locationMgr;
|
36
|
-
@synthesize locationStatus;
|
37
|
-
|
38
|
-
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
|
39
|
-
{
|
40
|
-
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
|
41
|
-
if (self) {
|
42
|
-
// Custom initialization
|
43
|
-
self.locationMgr = [[CLLocationManager alloc] init];
|
44
|
-
self.locationMgr.desiredAccuracy = kCLLocationAccuracyBest;
|
45
|
-
self.locationMgr.delegate = self;
|
46
|
-
[self logLocationAuth];
|
47
|
-
}
|
48
|
-
|
49
|
-
return self;
|
50
|
-
}
|
51
|
-
|
52
|
-
- (void)viewDidLoad
|
53
|
-
{
|
54
|
-
[super viewDidLoad];
|
55
|
-
// Do any additional setup after loading the view from its nib.
|
56
|
-
firstArg.returnKeyType = UIReturnKeyDone;
|
57
|
-
secondArg.returnKeyType = UIReturnKeyDone;
|
58
|
-
firstArg.delegate = self;
|
59
|
-
secondArg.delegate = self;
|
60
|
-
[NSTimer scheduledTimerWithTimeInterval:0.2
|
61
|
-
target:self
|
62
|
-
selector:@selector(logLocationAuthFromTimer:)
|
63
|
-
userInfo:nil
|
64
|
-
repeats:NO];
|
65
|
-
|
66
|
-
[firstArg setAccessibilityIdentifier:@"IntegerA"];
|
67
|
-
[secondArg setAccessibilityIdentifier:@"IntegerB"];
|
68
|
-
[computeSumButton setAccessibilityIdentifier:@"ComputeSumButton"];
|
69
|
-
[answerLabel setAccessibilityIdentifier:@"Answer"];
|
70
|
-
[locationStatus setAccessibilityIdentifier:@"locationStatus"];
|
71
|
-
|
72
|
-
UISwipeGestureRecognizer * swipe =[[UISwipeGestureRecognizer alloc]initWithTarget:self action:@selector(swipeUp:)];
|
73
|
-
swipe.direction = UISwipeGestureRecognizerDirectionUp;
|
74
|
-
[self.view addGestureRecognizer:swipe];
|
75
|
-
[swipe release];
|
76
|
-
|
77
|
-
computeSumButton.titleLabel.text = NSLocalizedString(@"main.button.computeSum", @"Compute Sum button");
|
78
|
-
}
|
79
|
-
|
80
|
-
-(void)swipeUp:(UISwipeGestureRecognizer*)gestureRecognizer
|
81
|
-
{
|
82
|
-
[secondArg resignFirstResponder];
|
83
|
-
}
|
84
|
-
|
85
|
-
|
86
|
-
- (void)logLocationAuthFromTimer:(NSTimer *)timer
|
87
|
-
{
|
88
|
-
[self logLocationAuth];
|
89
|
-
}
|
90
|
-
|
91
|
-
- (void)logLocationAuth
|
92
|
-
{
|
93
|
-
CLAuthorizationStatus status = [CLLocationManager authorizationStatus];
|
94
|
-
if (status != kCLAuthorizationStatusRestricted && status != kCLAuthorizationStatusDenied) {
|
95
|
-
locationStatus.on = YES;
|
96
|
-
} else {
|
97
|
-
locationStatus.on = NO;
|
98
|
-
}
|
99
|
-
}
|
100
|
-
|
101
|
-
- (void)viewDidUnload
|
102
|
-
{
|
103
|
-
[self setFirstArg:nil];
|
104
|
-
[self setSecondArg:nil];
|
105
|
-
[self setAnswerLabel:nil];
|
106
|
-
[self setLocationStatus:nil];
|
107
|
-
[super viewDidUnload];
|
108
|
-
// Release any retained subviews of the main view.
|
109
|
-
// e.g. self.myOutlet = nil;
|
110
|
-
}
|
111
|
-
|
112
|
-
- (BOOL)textFieldShouldReturn:(UITextField *)textField {
|
113
|
-
[textField resignFirstResponder];
|
114
|
-
return YES;
|
115
|
-
}
|
116
|
-
|
117
|
-
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
|
118
|
-
{
|
119
|
-
return (interfaceOrientation == UIInterfaceOrientationPortrait);
|
120
|
-
}
|
121
|
-
|
122
|
-
- (void)dealloc {
|
123
|
-
[self.locationMgr release];
|
124
|
-
self.locationMgr = nil;
|
125
|
-
[firstArg release];
|
126
|
-
[secondArg release];
|
127
|
-
[answerLabel release];
|
128
|
-
[computeSumButton release];
|
129
|
-
[super dealloc];
|
130
|
-
}
|
131
|
-
- (IBAction)testGesture:(id)sender
|
132
|
-
{
|
133
|
-
GestureTestViewController *test = [[GestureTestViewController alloc] initWithNibName:@"GestureTestViewController" bundle:nil];
|
134
|
-
[self presentViewController:test animated:YES completion:NULL];
|
135
|
-
}
|
136
|
-
|
137
|
-
- (IBAction)computeAction:(id)sender {
|
138
|
-
int a = [[firstArg text] intValue];
|
139
|
-
int b = [[secondArg text] intValue];
|
140
|
-
int sum = a + b;
|
141
|
-
NSString *newLabelValue = [NSString stringWithFormat:@"%d",sum];
|
142
|
-
[answerLabel setText:newLabelValue];
|
143
|
-
[answerLabel setAccessibilityLabel:newLabelValue];
|
144
|
-
}
|
145
|
-
|
146
|
-
- (IBAction)showAlert:(id)sender {
|
147
|
-
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Cool title"
|
148
|
-
message:@"this alert is so cool."
|
149
|
-
delegate:nil
|
150
|
-
cancelButtonTitle:@"Cancel"
|
151
|
-
otherButtonTitles:@"OK", nil];
|
152
|
-
[alert show];
|
153
|
-
[alert release];
|
154
|
-
}
|
155
|
-
|
156
|
-
- (IBAction)crashApp:(id)sender {
|
157
|
-
abort();
|
158
|
-
}
|
159
|
-
|
160
|
-
- (void)requestContactsPermission {
|
161
|
-
ABAddressBookRef book = [MyViewControllerViewController addressBookForPermissionRequest];
|
162
|
-
[self popContactsPermissionDialogWithAddressBook:book];
|
163
|
-
}
|
164
|
-
|
165
|
-
- (void)popContactsPermissionDialogWithAddressBook:(ABAddressBookRef)book {
|
166
|
-
ABAddressBookRequestAccessWithCompletion(book, ^(bool granted, CFErrorRef error) {
|
167
|
-
});
|
168
|
-
CFRelease (book);
|
169
|
-
}
|
170
|
-
|
171
|
-
+ (ABAddressBookRef)addressBookForPermissionRequest {
|
172
|
-
CFErrorRef error = NULL;
|
173
|
-
return ABAddressBookCreateWithOptions(NULL, &error);
|
174
|
-
}
|
175
|
-
|
176
|
-
- (IBAction)accessContactsAlert:(id)sender {
|
177
|
-
if ([MyViewControllerViewController addressBookAuthorizationStatus] == kABAuthorizationStatusNotDetermined) {
|
178
|
-
[self requestContactsPermission];
|
179
|
-
}
|
180
|
-
}
|
181
|
-
|
182
|
-
- (IBAction)accessLocationAlert:(id)sender {
|
183
|
-
CLLocationManager *locationManager = [[CLLocationManager alloc] init];
|
184
|
-
|
185
|
-
[locationManager startUpdatingLocation];
|
186
|
-
[locationManager stopUpdatingLocation];
|
187
|
-
}
|
188
|
-
|
189
|
-
+ (ABAuthorizationStatus)addressBookAuthorizationStatus {
|
190
|
-
return ABAddressBookGetAuthorizationStatus();
|
191
|
-
}
|
192
|
-
|
193
|
-
@end
|
1
|
+
/**
|
2
|
+
* Copyright 2012 Appium Committers
|
3
|
+
*
|
4
|
+
* Licensed to the Apache Software Foundation (ASF) under one
|
5
|
+
* or more contributor license agreements. See the NOTICE file
|
6
|
+
* distributed with this work for additional information
|
7
|
+
* regarding copyright ownership. The ASF licenses this file
|
8
|
+
* to you under the Apache License, Version 2.0 (the
|
9
|
+
* "License"); you may not use this file except in compliance
|
10
|
+
* with the License. You may obtain a copy of the License at
|
11
|
+
*
|
12
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
13
|
+
*
|
14
|
+
* Unless required by applicable law or agreed to in writing,
|
15
|
+
* software distributed under the License is distributed on an
|
16
|
+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
17
|
+
* KIND, either express or implied. See the License for the
|
18
|
+
* specific language governing permissions and limitations
|
19
|
+
* under the License.
|
20
|
+
*/
|
21
|
+
|
22
|
+
#import "MyViewControllerViewController.h"
|
23
|
+
#import <AddressBook/AddressBook.h>
|
24
|
+
#import <CoreLocation/CoreLocation.h>
|
25
|
+
|
26
|
+
@interface MyViewControllerViewController ()
|
27
|
+
|
28
|
+
@end
|
29
|
+
|
30
|
+
@implementation MyViewControllerViewController
|
31
|
+
@synthesize computeSumButton;
|
32
|
+
@synthesize answerLabel;
|
33
|
+
@synthesize firstArg;
|
34
|
+
@synthesize secondArg;
|
35
|
+
@synthesize locationMgr;
|
36
|
+
@synthesize locationStatus;
|
37
|
+
|
38
|
+
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
|
39
|
+
{
|
40
|
+
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
|
41
|
+
if (self) {
|
42
|
+
// Custom initialization
|
43
|
+
self.locationMgr = [[CLLocationManager alloc] init];
|
44
|
+
self.locationMgr.desiredAccuracy = kCLLocationAccuracyBest;
|
45
|
+
self.locationMgr.delegate = self;
|
46
|
+
[self logLocationAuth];
|
47
|
+
}
|
48
|
+
|
49
|
+
return self;
|
50
|
+
}
|
51
|
+
|
52
|
+
- (void)viewDidLoad
|
53
|
+
{
|
54
|
+
[super viewDidLoad];
|
55
|
+
// Do any additional setup after loading the view from its nib.
|
56
|
+
firstArg.returnKeyType = UIReturnKeyDone;
|
57
|
+
secondArg.returnKeyType = UIReturnKeyDone;
|
58
|
+
firstArg.delegate = self;
|
59
|
+
secondArg.delegate = self;
|
60
|
+
[NSTimer scheduledTimerWithTimeInterval:0.2
|
61
|
+
target:self
|
62
|
+
selector:@selector(logLocationAuthFromTimer:)
|
63
|
+
userInfo:nil
|
64
|
+
repeats:NO];
|
65
|
+
|
66
|
+
[firstArg setAccessibilityIdentifier:@"IntegerA"];
|
67
|
+
[secondArg setAccessibilityIdentifier:@"IntegerB"];
|
68
|
+
[computeSumButton setAccessibilityIdentifier:@"ComputeSumButton"];
|
69
|
+
[answerLabel setAccessibilityIdentifier:@"Answer"];
|
70
|
+
[locationStatus setAccessibilityIdentifier:@"locationStatus"];
|
71
|
+
|
72
|
+
UISwipeGestureRecognizer * swipe =[[UISwipeGestureRecognizer alloc]initWithTarget:self action:@selector(swipeUp:)];
|
73
|
+
swipe.direction = UISwipeGestureRecognizerDirectionUp;
|
74
|
+
[self.view addGestureRecognizer:swipe];
|
75
|
+
[swipe release];
|
76
|
+
|
77
|
+
computeSumButton.titleLabel.text = NSLocalizedString(@"main.button.computeSum", @"Compute Sum button");
|
78
|
+
}
|
79
|
+
|
80
|
+
-(void)swipeUp:(UISwipeGestureRecognizer*)gestureRecognizer
|
81
|
+
{
|
82
|
+
[secondArg resignFirstResponder];
|
83
|
+
}
|
84
|
+
|
85
|
+
|
86
|
+
- (void)logLocationAuthFromTimer:(NSTimer *)timer
|
87
|
+
{
|
88
|
+
[self logLocationAuth];
|
89
|
+
}
|
90
|
+
|
91
|
+
- (void)logLocationAuth
|
92
|
+
{
|
93
|
+
CLAuthorizationStatus status = [CLLocationManager authorizationStatus];
|
94
|
+
if (status != kCLAuthorizationStatusRestricted && status != kCLAuthorizationStatusDenied) {
|
95
|
+
locationStatus.on = YES;
|
96
|
+
} else {
|
97
|
+
locationStatus.on = NO;
|
98
|
+
}
|
99
|
+
}
|
100
|
+
|
101
|
+
- (void)viewDidUnload
|
102
|
+
{
|
103
|
+
[self setFirstArg:nil];
|
104
|
+
[self setSecondArg:nil];
|
105
|
+
[self setAnswerLabel:nil];
|
106
|
+
[self setLocationStatus:nil];
|
107
|
+
[super viewDidUnload];
|
108
|
+
// Release any retained subviews of the main view.
|
109
|
+
// e.g. self.myOutlet = nil;
|
110
|
+
}
|
111
|
+
|
112
|
+
- (BOOL)textFieldShouldReturn:(UITextField *)textField {
|
113
|
+
[textField resignFirstResponder];
|
114
|
+
return YES;
|
115
|
+
}
|
116
|
+
|
117
|
+
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
|
118
|
+
{
|
119
|
+
return (interfaceOrientation == UIInterfaceOrientationPortrait);
|
120
|
+
}
|
121
|
+
|
122
|
+
- (void)dealloc {
|
123
|
+
[self.locationMgr release];
|
124
|
+
self.locationMgr = nil;
|
125
|
+
[firstArg release];
|
126
|
+
[secondArg release];
|
127
|
+
[answerLabel release];
|
128
|
+
[computeSumButton release];
|
129
|
+
[super dealloc];
|
130
|
+
}
|
131
|
+
- (IBAction)testGesture:(id)sender
|
132
|
+
{
|
133
|
+
GestureTestViewController *test = [[GestureTestViewController alloc] initWithNibName:@"GestureTestViewController" bundle:nil];
|
134
|
+
[self presentViewController:test animated:YES completion:NULL];
|
135
|
+
}
|
136
|
+
|
137
|
+
- (IBAction)computeAction:(id)sender {
|
138
|
+
int a = [[firstArg text] intValue];
|
139
|
+
int b = [[secondArg text] intValue];
|
140
|
+
int sum = a + b;
|
141
|
+
NSString *newLabelValue = [NSString stringWithFormat:@"%d",sum];
|
142
|
+
[answerLabel setText:newLabelValue];
|
143
|
+
[answerLabel setAccessibilityLabel:newLabelValue];
|
144
|
+
}
|
145
|
+
|
146
|
+
- (IBAction)showAlert:(id)sender {
|
147
|
+
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Cool title"
|
148
|
+
message:@"this alert is so cool."
|
149
|
+
delegate:nil
|
150
|
+
cancelButtonTitle:@"Cancel"
|
151
|
+
otherButtonTitles:@"OK", nil];
|
152
|
+
[alert show];
|
153
|
+
[alert release];
|
154
|
+
}
|
155
|
+
|
156
|
+
- (IBAction)crashApp:(id)sender {
|
157
|
+
abort();
|
158
|
+
}
|
159
|
+
|
160
|
+
- (void)requestContactsPermission {
|
161
|
+
ABAddressBookRef book = [MyViewControllerViewController addressBookForPermissionRequest];
|
162
|
+
[self popContactsPermissionDialogWithAddressBook:book];
|
163
|
+
}
|
164
|
+
|
165
|
+
- (void)popContactsPermissionDialogWithAddressBook:(ABAddressBookRef)book {
|
166
|
+
ABAddressBookRequestAccessWithCompletion(book, ^(bool granted, CFErrorRef error) {
|
167
|
+
});
|
168
|
+
CFRelease (book);
|
169
|
+
}
|
170
|
+
|
171
|
+
+ (ABAddressBookRef)addressBookForPermissionRequest {
|
172
|
+
CFErrorRef error = NULL;
|
173
|
+
return ABAddressBookCreateWithOptions(NULL, &error);
|
174
|
+
}
|
175
|
+
|
176
|
+
- (IBAction)accessContactsAlert:(id)sender {
|
177
|
+
if ([MyViewControllerViewController addressBookAuthorizationStatus] == kABAuthorizationStatusNotDetermined) {
|
178
|
+
[self requestContactsPermission];
|
179
|
+
}
|
180
|
+
}
|
181
|
+
|
182
|
+
- (IBAction)accessLocationAlert:(id)sender {
|
183
|
+
CLLocationManager *locationManager = [[CLLocationManager alloc] init];
|
184
|
+
|
185
|
+
[locationManager startUpdatingLocation];
|
186
|
+
[locationManager stopUpdatingLocation];
|
187
|
+
}
|
188
|
+
|
189
|
+
+ (ABAuthorizationStatus)addressBookAuthorizationStatus {
|
190
|
+
return ABAddressBookGetAuthorizationStatus();
|
191
|
+
}
|
192
|
+
|
193
|
+
@end
|
@@ -1,28 +1,28 @@
|
|
1
|
-
/**
|
2
|
-
* Copyright 2012 Appium Committers
|
3
|
-
*
|
4
|
-
* Licensed to the Apache Software Foundation (ASF) under one
|
5
|
-
* or more contributor license agreements. See the NOTICE file
|
6
|
-
* distributed with this work for additional information
|
7
|
-
* regarding copyright ownership. The ASF licenses this file
|
8
|
-
* to you under the Apache License, Version 2.0 (the
|
9
|
-
* "License"); you may not use this file except in compliance
|
10
|
-
* with the License. You may obtain a copy of the License at
|
11
|
-
*
|
12
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
13
|
-
*
|
14
|
-
* Unless required by applicable law or agreed to in writing,
|
15
|
-
* software distributed under the License is distributed on an
|
16
|
-
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
17
|
-
* KIND, either express or implied. See the License for the
|
18
|
-
* specific language governing permissions and limitations
|
19
|
-
* under the License.
|
20
|
-
*/
|
21
|
-
|
22
|
-
#import <UIKit/UIKit.h>
|
23
|
-
|
24
|
-
@interface TA2AppDelegate : UIResponder <UIApplicationDelegate>
|
25
|
-
|
26
|
-
@property (strong, nonatomic) UIWindow *window;
|
27
|
-
|
28
|
-
@end
|
1
|
+
/**
|
2
|
+
* Copyright 2012 Appium Committers
|
3
|
+
*
|
4
|
+
* Licensed to the Apache Software Foundation (ASF) under one
|
5
|
+
* or more contributor license agreements. See the NOTICE file
|
6
|
+
* distributed with this work for additional information
|
7
|
+
* regarding copyright ownership. The ASF licenses this file
|
8
|
+
* to you under the Apache License, Version 2.0 (the
|
9
|
+
* "License"); you may not use this file except in compliance
|
10
|
+
* with the License. You may obtain a copy of the License at
|
11
|
+
*
|
12
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
13
|
+
*
|
14
|
+
* Unless required by applicable law or agreed to in writing,
|
15
|
+
* software distributed under the License is distributed on an
|
16
|
+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
17
|
+
* KIND, either express or implied. See the License for the
|
18
|
+
* specific language governing permissions and limitations
|
19
|
+
* under the License.
|
20
|
+
*/
|
21
|
+
|
22
|
+
#import <UIKit/UIKit.h>
|
23
|
+
|
24
|
+
@interface TA2AppDelegate : UIResponder <UIApplicationDelegate>
|
25
|
+
|
26
|
+
@property (strong, nonatomic) UIWindow *window;
|
27
|
+
|
28
|
+
@end
|