Hello,
I build an app which allows users to view code. As it exists today, we have line wrapping enabled on our UITextViews that house our code, but we would ideally like to be able to disable line-wrapping.
Our view hierarchy can be described as such:
We have UITableViewController whose cells contain a UIScrollView that then contains a UITextView. The UITextView has all of the contents of the code that the user is viewing.
It initially works fine, but after continuous, we frequently run into CoreAnimation memory allocation issues that result in flickering and poor scroll performance:
[Render] CoreAnimation: failed to allocate 3821632 bytes
Our cell is implemented pretty trivially:
The only bit of custom drawing we're doing here is related to drawing the line numbers in the leading gutter of the view, and that's being done in the layout manager. We still encounter memory allocation issues without the custom drawing.
After profiling using instruments, it seems that most of the work is being done in CGSColorMaskCopyARGB8888. I've also profiled for memory leaks, of which there are none.
I'd greatly appreciate some assistance in being able to efficiently implement a UITextView that doesn't have line-wrapping enabled. It seems to fall apart in this use case with nested scroll views and large code files with syntax highlighting.
I build an app which allows users to view code. As it exists today, we have line wrapping enabled on our UITextViews that house our code, but we would ideally like to be able to disable line-wrapping.
Our view hierarchy can be described as such:
We have UITableViewController whose cells contain a UIScrollView that then contains a UITextView. The UITextView has all of the contents of the code that the user is viewing.
It initially works fine, but after continuous, we frequently run into CoreAnimation memory allocation issues that result in flickering and poor scroll performance:
[Render] CoreAnimation: failed to allocate 3821632 bytes
Our cell is implemented pretty trivially:
The only bit of custom drawing we're doing here is related to drawing the line numbers in the leading gutter of the view, and that's being done in the layout manager. We still encounter memory allocation issues without the custom drawing.
After profiling using instruments, it seems that most of the work is being done in CGSColorMaskCopyARGB8888. I've also profiled for memory leaks, of which there are none.
I'd greatly appreciate some assistance in being able to efficiently implement a UITextView that doesn't have line-wrapping enabled. It seems to fall apart in this use case with nested scroll views and large code files with syntax highlighting.