如何使用swift通过UIAlertAction打开输入附件视图?

时间:2016-06-13 06:40:13

标签: swift uitextview uialertcontroller uialertaction

我有一个if (my_condition_1) ++x; else if (my_condition_2) --x; ,其中包含一些UIAlertController,如下所示。

UIAlertActions

当用户点击"添加更多"动作,它应该关闭let alertController = UIAlertController(title: nil, message : nil, preferredStyle: .ActionSheet) let addMoreAction = UIAlertAction(title: "Add more", style: .Default) { (action) in // Want to be able to call an input accessory view from here } alertController.addAction(addMoreAction) self.presentViewController(alertController, animated: true, completion: nil) 并打开键盘,键盘顶部附有UIAlertController。 (就像你在Facebook Messenger等聊天应用中看到的那样)。

如何使用swift实现此目的?

1 个答案:

答案 0 :(得分:0)

也许您正在寻找fb_graph2 gem财产。您可以查看this tutorial。使用此功能,您可以创建可以显示在键盘顶部的自己的视图。