Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Anviking committed Jul 28, 2013
1 parent b4fa588 commit 23b744b
Showing 1 changed file with 1 addition and 30 deletions.
31 changes: 1 addition & 30 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,36 +1,7 @@
Chromatism
==========

This is an experimation of a Syntax Highlighting textView using a tableView and CoreText. It consists of a UITextView with a UITableVIew overlay. The UITextView has its textColor set to `[UIColor clearColor]` and ints only purpose is to provide a textinput. Ontop of the textView there is a `UITableView`, which render the lines currently visible.
## iOS 7
Most of this code will be thrown away in favor for new iOS 7 features.

## Bugs
At this moment there are *a lot* of bugs that need fixing. This is an experiment and a work in progress.

##This is what happens when the text editor is created:

1. The text is broken up into lines by a CTTypesetter and stored in an array.
2. The tableview asks for the lines that should be visible.
3. The tableView creates UITableViewCells which draw the lines.

##What happens upon scrolling:
1. The tableView takes the cells that go offscreen and reuse them by telling them to draw new lines. Cells still onscreen are not redrawn.

##What happens upon text change:
1. What type of text change is it?
2. If it can be handled by slightly modifying the lines, do so. No typesetter is required to look through the entire text.
3. If not there is no option but to recalculate everything with the typesetter.



The tokenizing itself uses regex to modify an attributed string. The tokenizer tries to tokenizer as little as possible. If the user types a letter most regex patterns are going to be applied to the current line.

##Performance
Performance is the whole reason Chromatism was created.

###Screenshot of Time Profiling:
![Alt text](http://anviking.com/Time.png "Performance")
This is the beginning of a syntax highlighting `UITextView` for iOS. Currently it only knows about Obj-C. Previous Chromatism used a combination of `CoreText` and `UITableView` for performance, but luckily that is not needed anymore.



0 comments on commit 23b744b

Please sign in to comment.