I'm attempting to use this new constant, but I found some difficulties. The following is a sample of what I'm trying to do:
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
UIView *testView = [[UIView alloc] initWithFrame:CGRectMake(0, 140, 320, 320)];
testView.backgroundColor = [UIColor redColor];
[self.view addSubview:testView];
UIButton *testButton = [UIButton buttonWithType:UIButtonTypeRoundedRect];
testButton.frame = CGRectMake(110, 400, 100, 50);
testButton.accessibilityTraits = UIAccessibilityTraitAllowsDirectInteraction;
testButton.accessibilityLabel = @"button";
[self.view addSubview:testButton];
[testButton addTarget:self action:@selector(testResult) forControlEvents:UIControlEventTouchUpInside];
label = [[UILabel alloc] initWithFrame:CGRectMake(10, 10, 300, 44)];
label.backgroundColor = [UIColor greenColor];
[self.view addSubview:label];
}
- (void)testResult
{
label.text = @"hello everyone";
}
With VoiceOver on, it looks like the button actually responds to one tap only, but the label remains blank. Turning Voice Over off, the label properly reports "hello everyone".