Context Menus with AsyncDisplayKit

366 views Asked by At

I am trying to implement a context menu for a UIImageView, but the issue is this app is not using UITableView, it uses ASTable from AsyncDisplayKit. Has anyone implemented a context menu using that framework? Is there a way to extend UIImageView and create the context menu there?

1

There are 1 answers

0
Ruswan On

You can still use UITableView delegate to configure context menu for each cell node. Simply implement tableView(_:contextMenuConfigurationForRowAt:point:) on your ASTableNode delegate or add context menu interaction to your view.

private func configureContextMenu() {
    guard #available(iOS 13.0, *) else {
        return
    }

    let contextMenu = UIContextMenuInteraction(delegate: self)
    view.addInteraction(contextMenu)
}

Source: