有没有办法可以使用sdcalertview在alertview中添加tableview?

时间:2017-08-03 13:57:50

标签: swift xcode

我想知道这是可能的还是另类的?我只需要在我的警报视图中进行多选,我很难找到一个好的解决方案

2 个答案:

答案 0 :(得分:0)

我使用一个名为MSAlertController的库来执行此操作,我使用MSAlertControllerEmbedComponent成功地在我的警报中嵌入表格,然后传递一个tableview。

您可以在此处获取:https://github.com/MilitiaSoftworks/MSAlertController

这是一个非常新的图书馆,所以不幸的是他们没有任何cocoapods支持,他们的文档仍然是WIP,但如果您需要,我可以帮助您实施。我发现它很简单。

答案 1 :(得分:0)

之前我没有使用过SDCAlertView,但你可以使用你的tableView呈现一个普通的ViewController,使用vc.modalPresentationStyle = .overCurrentContext这将显示你的VC,但是之前的VC仍然在后台。

从视觉上看,它看起来很像警报,但您可以完全控制它的外观。

let vc = ViewController(nibName: "ViewController", bundle: Bundle.main) as ViewController
vc.dataSource = datasourceWith(***.****ToDownload())
vc.modalPresentationStyle = .overCurrentContext
相关问题