Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for accessibility label on menu button #195

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions JASidePanels/Source/JASidePanelController.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ typedef enum _JASidePanelState {
@property (nonatomic, strong) UIViewController *leftPanel; // optional
@property (nonatomic, strong) UIViewController *centerPanel; // required
@property (nonatomic, strong) UIViewController *rightPanel; // optional
@property (nonatomic, copy) NSString *leftButtonForCenterPanelAccessibilityLabel; // optional, e.g. "Main Menu"

// show the panels
- (void)showLeftPanel:(BOOL)animated __attribute__((deprecated("Use -showLeftPanelAnimated: instead")));
Expand Down
5 changes: 4 additions & 1 deletion JASidePanels/Source/JASidePanelController.m
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ @implementation JASidePanelController
@synthesize leftPanelContainer = _leftPanelContainer;
@synthesize rightPanelContainer = _rightPanelContainer;
@synthesize centerPanelContainer = _centerPanelContainer;
@synthesize leftButtonForCenterPanelAccessibilityLabel = _leftButtonForCenterPanelAccessibilityLabel;
@synthesize tapView = _tapView;
@synthesize style = _style;
@synthesize state = _state;
Expand Down Expand Up @@ -953,7 +954,9 @@ - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(_
#pragma mark - Public Methods

- (UIBarButtonItem *)leftButtonForCenterPanel {
return [[UIBarButtonItem alloc] initWithImage:[[self class] defaultImage] style:UIBarButtonItemStylePlain target:self action:@selector(toggleLeftPanel:)];
UIBarButtonItem *leftButton = [[UIBarButtonItem alloc] initWithImage:[[self class] defaultImage] style:UIBarButtonItemStylePlain target:self action:@selector(toggleLeftPanel:)];
leftButton.accessibilityLabel = _leftButtonForCenterPanelAccessibilityLabel;
return leftButton;
}

- (void)showLeftPanel:(BOOL)animated {
Expand Down