The same context menu is displayed the different order Xcode 12. Swift 5

Viewed 509

I have a button on UICollectionViewCell and set a context menu to this button. However, the context menu gets reversed when I scroll this cell to bottom and open context menu again. self.moreButton is a UIButton.

self.moreButton.showsMenuAsPrimaryAction = YES;
self.moreButton.menu = [UIMenu menuWithTitle:@"title" children:@[renameAction, deleteAction, shareAction]];
1 Answers

I believe this is the expected behavior. When the context menu shows above the source view, the contents are inverted because the order of the array doesn’t determine “up to down” but rather “closest to the content to farthest from the content”.

Related