I’m creating an app for the iPad for objective c coding on the go. Not to make this sound weird but I’d love to be pointed in the right direction to implant syntax highlighting or possibly code completion.
Thanks!
If possible could the admin email me (if possible?)
I didn’t post this on stack overflow because they aren’t as nice as you codea’s
@TD2 the Codea editor is implemented using a UITextView. The highlighting is done by overlaying subviews in the appropriate positions — usually UILabels. They are dequeued from a re-use pool, similar to the way UITableViewCells work. During scrolling, the lines requiring re-highlighting pull markers out of the pool and lines that have moved off screen dump their markers back into the pool.
There are other ways to do syntax highlighting, however. There is a WWDC video from 2011 that shows how to achieve it using a UIWebView with javascript. This way is probably more straightforward and I know a developer who has used this method for a LaTeX editor.
Code completion is just performed by analysing the current word and displaying a view containing completions on the UIInputAccessoryView. This is just hooking into the selectionChanged method on the UITextView delegate. A similar thing could be done with a webview-based solution as well.