Working with Context Menus
Context menus in UIKit offer a great way to provide additional actions for a particular view. In this series we will see how we can build dynamic menus, nest menus together, and control the presentation and preview of the menu as it appears.
Length: 33 minutes.
Context menus are a great affordance for performing related actions to a UI element. Users can tap and hold to view the context menu, and the gesture is consistent across the OS so users will likely already be familiar with it. In this episode we'll show how to set up a basic context menu with a custom preview with normal and destructive actions.
In this episode we will see how to nest menus inside each other as well as dynamically choosing when to show a nested menus contents inline.
Another common use of context menus is with table views and collection views. In this episode we will explore adding a menu to a table view cell that allows copying a font or toggling it from a favorites list.
Let's see how we can provide a custom view controller to preview when a context menu is opened. This is analogous to (and a replacement for) the Peek/Pop interaction for devices that supported 3D Touch.