... highlight.js. This is actually quite fast! It will never be as fast as a native solution, but it's fast enough to be used on a real-time editor. It comes with a custom-made HTML parser for creating NSAttributtedStrings, is pre-processing the themes, and is preloading the JS libraries. As result it's taking around of 50 ms on my iPhone 6s for processing 500 lines of code.