如何在编辑 UITextView 时删除 iPad 的底部 copy/paste 栏?

How to remove the iPad's bottom copy/paste bar when editing a UITextView?

我有一个允许用户编辑 UITextView 的应用程序,但是 copy/paste/cut 栏在 iPad 上弹出,挡住了界面底部的一些部分,因为以下屏幕截图显示:

我宁愿摆脱它​​而不是调整界面,有什么办法可以做到这一点?

注意:这仅出现在 iPad!

编辑:我的 UITextView 是完全可编辑的,因此,这不是 How disable Copy, Cut, Select, Select All in UITextView 的副本!另外,我不想只禁用按钮,我希望整个底部栏都消失!

编辑 2:为了更清楚地更新图像,因为一些答案正在解决光标附近出现的黑色小问题。

你可以隐藏它如下,

yourTextView.inputAssistantItem.leadingBarButtonGroups = []
yourTextView.inputAssistantItem.trailingBarButtonGroups = []