4

I've got a UITextView, wired with a TextKit stack: custom NSTextStorage subclass, and standard NSLayoutManager + NSTextContainer instances.

While editing a large document (~80kb, ~200 URL Links), our app's main thread freeze during the "Link-ification" process for over 10 seconds: URL detection + highlight.

After an Instruments sessions, i found out that the method 'NSTextStorage.processEditing()' is being called ~800 times -for the scenario described above-.

For the record, the UITextView instance's detectors are being set as follows:

self.dataDetectorTypes = UIDataDetectorTypeAll;

First thing i've tested is: using Apple's NSTextStorage class, instead of a custom subclass. Results were exactly the same: processEditing is a severe bottleneck.

I'm looking for ways to speed up this process. Any suggestions will be very welcome!

Thanks in advance!!

0 Answers0