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

Fixes iPad accessibility #124

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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions REMenu/REMenu.m
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ @interface REMenu ()
@property (strong, readwrite, nonatomic) NSMutableArray *itemViews;
@property (weak, readwrite, nonatomic) UINavigationBar *navigationBar;
@property (strong, readwrite, nonatomic) UIToolbar *toolbar;
@property (strong, nonatomic) UIView *firstItem;

@end

Expand Down Expand Up @@ -218,12 +219,17 @@ - (void)showFromRect:(CGRect)rect inView:(UIView *)view
[itemView addSubview:item.customView];
}
[self.menuView addSubview:itemView];
if (!self.firstItem) {
self.firstItem = itemView;
}
}

// Set up frames
//
self.menuWrapperView.frame = CGRectMake(0, -self.combinedHeight - navigationBarOffset, rect.size.width, self.combinedHeight + navigationBarOffset);
self.menuView.autoresizesSubviews = NO;
self.menuView.frame = self.menuWrapperView.bounds;
self.menuView.autoresizesSubviews = YES;
if (REUIKitIsFlatMode() && self.liveBlur) {
self.toolbar.frame = self.menuWrapperView.bounds;
}
Expand Down Expand Up @@ -264,6 +270,7 @@ - (void)showFromRect:(CGRect)rect inView:(UIView *)view
if ([self.delegate respondsToSelector:@selector(didOpenMenu:)]) {
[self.delegate didOpenMenu:self];
}
UIAccessibilityPostNotification(UIAccessibilityScreenChangedNotification, self.firstItem);
}];
} else {
[UIView animateWithDuration:self.animationDuration
Expand All @@ -279,6 +286,7 @@ - (void)showFromRect:(CGRect)rect inView:(UIView *)view
if ([self.delegate respondsToSelector:@selector(didOpenMenu:)]) {
[self.delegate didOpenMenu:self];
}
UIAccessibilityPostNotification(UIAccessibilityScreenChangedNotification, self.firstItem);
}];

}
Expand All @@ -296,6 +304,7 @@ - (void)showFromRect:(CGRect)rect inView:(UIView *)view
if ([self.delegate respondsToSelector:@selector(didOpenMenu:)]) {
[self.delegate didOpenMenu:self];
}
UIAccessibilityPostNotification(UIAccessibilityScreenChangedNotification, self.firstItem);
}];
}
}
Expand Down
2 changes: 1 addition & 1 deletion REMenu/REMenuItemView.m
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ - (id)initWithFrame:(CGRect)frame menu:(REMenu *)menu item:(REMenuItem*) item ha
});
[self addSubview:_subtitleLabel];
} else {
titleFrame = CGRectMake(self.item.textOffset.width == 0.0 && self.item.textOffset.height == 0.0 ? self.menu.textOffset.width : self.item.textOffset.width, self.item.textOffset.width == 0.0 && self.item.textOffset.height == 0.0 ? self.menu.textOffset.height : self.item.textOffset.height, 0, frame.size.height);
titleFrame = CGRectMake(self.item.textOffset.width == 0.0 && self.item.textOffset.height == 0.0 ? self.menu.textOffset.width : self.item.textOffset.width, self.item.textOffset.width == 0.0 && self.item.textOffset.height == 0.0 ? self.menu.textOffset.height : self.item.textOffset.height, frame.size.width, frame.size.height);
}

_titleLabel = ({
Expand Down