使用核心文本重新实现UITextView和UITextField

时间:2012-09-18 15:01:53

标签: ios uitextfield uitextview core-text uitextinput

使用核心文本是否有UITextViewUITextField的开源重新实现?

Apple的SimpleTextInputSimpleCoreTextViewEditableCoreTextView个类,明确说明:

     File: SimpleCoreTextView.m
 Abstract: 

 A view that draws text, reasons about layout, and manages a selection over its text range.

 IMPORTANT: Its use of CoreText is naive and inefficient, it deals only with
 left-to-right text layout, and it is by no means a good template for any text
 editor.  It is a toy implementation included only to illustrate how to bind
 the system keyboard to some pre-existing text editor.

换句话说,它没有处理,例如阿拉伯语,效率低下。

根据Core Text和UITextInput协议系列,我们有什么替代方案可以完全实现可编辑的文本字段或文本视图?

1 个答案:

答案 0 :(得分:1)

您可以使用或引用OmniGroup's TextEditor 用于实现可编辑的文本字段或文本视图,基于核心文本和UITextInput