Contents

preferredElementSize

The size of the menu’s child elements.

Declaration

var preferredElementSize: UIMenu.ElementSize { get set }

Discussion

This property allows you to choose between different layouts in the context menu:

  • The UIMenu.ElementSize.small size gives the menu a more compact, side-by-side appearance, allowing you to fit more actions in a single row.

  • The UIMenu.ElementSize.medium size gives the menu the side-by-side appearance, but shows additional detail for each action. The text-editing menu uses this element size to display the standard edit menu.

  • The UIMenu.ElementSize.large size gives the menu its default, full-width appearance.

[Image]

If you specify the UIMenu.ElementSize.small or UIMenu.ElementSize.medium sizes, the menu displays any items beyond the first three (for medium) or four (for small) as full-size elements.

This property doesn’t have an effect if you build your app with Mac Catalyst.

See Also

Specifying size of menu elements