An UITextView with Syntax Highlighting and Pan-Gesture Navigation / Selection
Objective-C
Latest commit c463097 Dec 21, 2013 Sam Rijs Merge.
Permalink
Failed to load latest commit information.
NLTextView.xcodeproj Add example Dec 21, 2013
NLTextView Initial Implementation Dec 21, 2013
NLTextViewExample Add example Dec 21, 2013
NLTextViewTests Initial Commit Dec 21, 2013
README.md Update README.md Dec 21, 2013

README.md

NLTextView

An UITextView with Syntax Highlighting and Pan-Gesture Navigation / Selection

Gestures

The cursor can be navigated by panning left or right over the text view. To create a selection, or expand an existing one, a pan-to-zoom gesture can be used.

Syntax Highlighting

Syntax highlighting is controlled by the properties highlightDefinition and highlightTheme.

highlightDefinition is a mapping of hightlight identifiers to highlight regular expressions. For example:

@{@"number": @"[0-9]+",
  @"word":   @"[a-zA-Z]+"}

highlightTheme is a mapping of the same highlight identifiers to UIColors. For example:

@{@"number": [UIColor redColor],
  @"word:    [UIColor greenColor]}

By default, a nice highlighting theme is included and the highlight definition is read from a file in the bundle called Syntax.plist.