今天扩展/小部件中的UIMenucontroller

时间:2017-06-07 12:53:38

标签: swift today-extension uimenucontroller

我今天的扩展程序中有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?) {        

}

这些功能也被称为!但菜单未显示。

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

CopableLabel

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

所以,我的问题是在今日扩展/小部件中使用UIMenucontroller有一些限制吗?

0 个答案:

没有答案
相关问题