我可以为警报控制器添加长按事件吗

Can I add long press event for alert controller

我可以在操作 sheet 模式下为警报控制器添加长按事件吗?

如果用户长按想要在正常警报模式下再显示一个弹出窗口。

   let actionSheet = UIAlertController.init(title: "Favourites", message: nil, preferredStyle: .actionSheet)

    if(favLocations.count != 0){

        for i in 0...(favLocations.count - 1){
            actionSheet.addAction(UIAlertAction.init(title: favLocations[i].villageName, style: UIAlertActionStyle.default, handler: { (action) in

                self.tbLocation.text = self.favLocations[i].villageName


                }))
        }
    }

    actionSheet.addAction(UIAlertAction.init(title: "Choose Locations", style: UIAlertActionStyle.destructive, handler: { (action) in
        self.showAllLocationAvailable()
    }))
    actionSheet.addAction(UIAlertAction.init(title: "Cancel", style: UIAlertActionStyle.cancel, handler: { (action) in
    }))

    self.present(actionSheet, animated: true, completion: nil)

我认为在当前的 iOS SDK 中是不可能的。您可能想要实现自己的 AlertController 或寻找一些开源库。