forked from twitter-archive/twui
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fleshed out the accessibility for TUIControl and TUIButton
- Loading branch information
Showing
13 changed files
with
208 additions
and
97 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// | ||
// TUIButton+Accessibility.h | ||
// TwUI | ||
// | ||
// Created by Josh Abernathy on 7/29/11. | ||
// Copyright 2011 __MyCompanyName__. All rights reserved. | ||
// | ||
|
||
#import "TUIButton.h" | ||
|
||
|
||
@interface TUIButton (Accessibility) | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// | ||
// TUIButton+Accessibility.m | ||
// TwUI | ||
// | ||
// Created by Josh Abernathy on 7/29/11. | ||
// Copyright 2011 __MyCompanyName__. All rights reserved. | ||
// | ||
|
||
#import "TUIButton+Accessibility.h" | ||
|
||
|
||
@implementation TUIButton (Accessibility) | ||
|
||
- (NSString *)accessibilityLabel | ||
{ | ||
if(accessibilityLabel == nil) { | ||
return [self currentTitle]; | ||
} | ||
|
||
return accessibilityLabel; | ||
} | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// | ||
// TUIControl+Accessibility.h | ||
// TwUI | ||
// | ||
// Created by Josh Abernathy on 7/29/11. | ||
// Copyright 2011 __MyCompanyName__. All rights reserved. | ||
// | ||
|
||
#import "TUIControl.h" | ||
|
||
|
||
@interface TUIControl (Accessibility) | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// | ||
// TUIControl+Accessibility.m | ||
// TwUI | ||
// | ||
// Created by Josh Abernathy on 7/29/11. | ||
// Copyright 2011 __MyCompanyName__. All rights reserved. | ||
// | ||
|
||
#import "TUIControl+Accessibility.h" | ||
|
||
|
||
@implementation TUIControl (Accessibility) | ||
|
||
|
||
#pragma mark NSAccessibility | ||
|
||
- (NSArray *)accessibilityActionNames | ||
{ | ||
return [self allControlEvents] != 0 ? [NSArray arrayWithObject:NSAccessibilityPressAction] : [super accessibilityActionNames]; | ||
} | ||
|
||
- (NSString *)accessibilityActionDescription:(NSString *)action | ||
{ | ||
if([action isEqualToString:NSAccessibilityPressAction]) { | ||
return NSLocalizedString(@"press", @""); | ||
} else { | ||
return nil; | ||
} | ||
} | ||
|
||
- (void)accessibilityPerformAction:(NSString *)action | ||
{ | ||
if([action isEqualToString:NSAccessibilityPressAction]) { | ||
[self sendActionsForControlEvents:TUIControlEventAllTouchEvents]; | ||
} | ||
} | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.