如何在 iOS 中向 UITextView 添加 toggleBoldface 选项?

gen*_*aks 2 ios swift

我希望将 toggleBoldface、toggleItalics 和 toggleUnderline 添加到 UITextView 的编辑选项中。如何才能做到这一点?最好在 Swift 中。

rma*_*ddy 5

启用文本视图的allowsEditingTextAttributes属性。