I have a parent that presents a child view controller.
view.addSubview(commentController.view)
addChild(commentController)
commentController.didMove(toParent: self)
Really basic stuff and everything works well.
Until I implemented
func tableView(_ tableView: UITableView, contextMenuConfigurationForRowAt indexPath: IndexPath, point: CGPoint) -> UIContextMenuConfiguration?
Whenever I long-press a cell, which should present a UIMenu, I receive this error:
Failed to find a presenting view controller for view. The interaction's view (or an ancestor) must have an associated view controller for presentation to work
I've never seen this error before, and I can't find it anywhere on line.
It doesn't look like I have any delegate method to direct the presentation to a specific view controller.
For example if I wanted to present a modal on top of this child I could do something like:
parent?.present(vc, animated: true)
I'm not sure how to fix this.
So to sum up this issue:
I have a child view controller with a UITableView
. I'm trying to use the delegate method for presenting a UIMenu
. It won't work, and I assume because it is a child view controller, but no idea why or how to fix it