Skip to main content
Language

Customize Menu Items

PhotoEditor SDK supports full control over the menu items used in the editor UI.

Configure menu items#

The tool menu items displayed in the main menu can be configured through the PhotoEditViewController options. The property menuItems takes an array of PhotoEditMenuItems. Here, we first create an array of MenuItems which will be converted to a PhotoEditMenuItem.

Note that items for tools not included in your license subscription will be hidden automatically.

PhotoEditMenuItem#

PhotoEditMenuItem is an enum with two possible cases:

  1. case tool(ToolMenuItem) represents a tool that can be pushed onto the stack. It has a ToolMenuItem as an associated value, which has a title, an icon and the class of the tool that should be instantiated.
  2. case action(ActionMenuItem) represents an action that should be executed when this menu item is selected. It has an ActionMenuItem as an associated value, which has a title, an icon, the closure that should be executed and which can update the current photo edit model, and a state closure that is used to query the active state of the action.

The .tool case can be used to present any subclass of PhotoEditToolController, making it easier to add your very own custom tool controllers to the SDK.