Swift UIMenucontroller在今天的扩展/小部件中

Swift UIMenucontroller在今天的扩展/小部件中,swift,today-extension,uimenucontroller,Swift,Today Extension,Uimenucontroller,我今天的分机中有UICollectionView。我试图在用户触摸单元格时显示UIMenucontroller。为此,我实现了三个功能: override func collectionView(_ collectionView: UICollectionView, shouldShowMenuForItemAt indexPath: IndexPath) -> Bool { return true } override func collectionView(_ collect

我今天的分机中有UICollectionView。我试图在用户触摸单元格时显示UIMenucontroller。为此,我实现了三个功能:

override func collectionView(_ collectionView: UICollectionView, shouldShowMenuForItemAt indexPath: IndexPath) -> Bool {
    return true
}

override func collectionView(_ collectionView: UICollectionView, canPerformAction action: Selector, forItemAt indexPath: IndexPath, withSender sender: Any?) -> Bool {

    return action == #selector(copy(_:))
}

override func collectionView(_ collectionView: UICollectionView, performAction action: Selector, forItemAt indexPath: IndexPath, withSender sender: Any?) {        

}
这些函数也被称为!但菜单没有显示

后来我尝试了另一种方法:

结果类似:调用所有函数,但不显示菜单

所以,我的问题是,在今天的扩展/小部件中使用UIMenucontroller是否存在一些限制