Skip to content

Commit

Permalink
Merge branch 'main' into joannaqu/disabled-accessibility
Browse files Browse the repository at this point in the history
  • Loading branch information
joannaquu authored Jul 30, 2024
2 parents f6d1c16 + 6360f50 commit 974db78
Showing 1 changed file with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ - (instancetype)init {
self = [super init];
if (self != nil)
{
_selectedCityIndex = [[NSIndexPath alloc] initWithIndex:0];
_selectedCityIndex = [NSIndexPath indexPathForItem:2 inSection:1];
}
return self;
}
Expand All @@ -21,7 +21,7 @@ - (void)loadView {
[super loadView];
MSFButton *demoButton = [[MSFButton alloc] initWithStyle:MSFButtonStyleOutlineAccent];
[demoButton setTitle:@"Show PopupMenu" forState:UIControlStateNormal];
[demoButton addTarget:self action:@selector(showPopupMenu) forControlEvents:UIControlEventTouchUpInside];
[demoButton addTarget:self action:@selector(showPopupMenu:) forControlEvents:UIControlEventTouchUpInside];

UIStackView *stack = [[UIStackView alloc] initWithArrangedSubviews:@[demoButton]];
[stack setAlignment:UIStackViewAlignmentTop];
Expand All @@ -41,7 +41,7 @@ - (void)loadView {
]];
}

- (void)showPopupMenu {
- (void)showPopupMenu:(id)sender {
MSFPopupMenuItem *montreal = [[MSFPopupMenuItem alloc] initWithImageName:@"Montreal"
generateSelectedImage:NO
title:@"Montréal"
Expand Down Expand Up @@ -112,9 +112,8 @@ - (void)showPopupMenu {
items:@[montreal, toronto, vancouver]];
MSFPopupMenuSection *unitedStates = [[MSFPopupMenuSection alloc] initWithTitle:@"United States"
items:@[lasVegas, phoenix, sanFrancisco, seattle]];
UIView *source = [self view];
MSFPopupMenuController *popupMenu = [[MSFPopupMenuController alloc] initWithSourceView:source
sourceRect:[source bounds]
MSFPopupMenuController *popupMenu = [[MSFPopupMenuController alloc] initWithSourceView:sender
sourceRect:[sender bounds]
presentationOrigin:-1
presentationDirection:MSFDrawerPresentationDirectionDown
preferredMaximumHeight:-1];
Expand Down

0 comments on commit 974db78

Please # to comment.