UIContextMenuInteraction got a new property with iOS 14 for "Specifying Menu Appearance" (that's the name of the section in the docs):
https://developer.apple.com/documentation/uikit/uicontextmenuinteraction?changes=latest_minor
However, this property is ready-only! Is it read only by design or mistake? If it's by design, why the name of the section in the docs suggests we're able to specify the menu appearance?
https://developer.apple.com/documentation/uikit/uicontextmenuinteraction?changes=latest_minor
However, this property is ready-only! Is it read only by design or mistake? If it's by design, why the name of the section in the docs suggests we're able to specify the menu appearance?
The documentation is implying a feature that does not exist. menuAppearance only tells you what the appearance is, it does not allow you to control it.
The appearance is controlled by the nature of how the UIContextMenuInteraction is triggered. UIControls always create menus with the .compact appearance. Other UIContextMenuInteractions will produce .rich or .compact based on how they are triggered – a context click gesture will trigger .compact for example.
The appearance is controlled by the nature of how the UIContextMenuInteraction is triggered. UIControls always create menus with the .compact appearance. Other UIContextMenuInteractions will produce .rich or .compact based on how they are triggered – a context click gesture will trigger .compact for example.