Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. iOS
  3. Highlightr

Highlightr

MITSwift2.3.0

iOS & macOS syntax highlighter built with Swift, using highlight.js to support 185 languages and 89 styles.

GitHubGitHub
1.9k stars300 forks0 contributors

What is Highlightr?

Highlightr is an iOS and macOS syntax highlighter built with Swift that uses highlight.js to convert plain code strings into formatted NSAttributedString objects. It supports 185 programming languages and 89 visual styles, enabling developers to add syntax highlighting to text editors, code viewers, or any app displaying code. The project solves the need for a ready-to-use, multi-language syntax highlighter within Apple's ecosystem without requiring native parsing implementations.

Target Audience

iOS and macOS developers building applications that display or edit code, such as code editors, documentation tools, educational apps, or developer utilities. It's particularly useful for those who need broad language support and customizable themes without implementing highlighting from scratch.

Value Proposition

Developers choose Highlightr because it leverages the widely-used highlight.js library, providing extensive language support and theme variety out of the box. Its integration with Swift and Apple's JavaScriptCore ensures decent performance for real-time editing, while its simple API makes it easy to add syntax highlighting to existing projects.

Overview

iOS & OSX Syntax Highlighter.

Use Cases

Best For

  • Adding syntax highlighting to iOS or macOS code editor apps
  • Displaying formatted code snippets in documentation or tutorial apps
  • Building educational coding apps that need multi-language support
  • Enhancing developer tools with real-time code highlighting
  • Creating custom text editors with live syntax feedback
  • Embedding code examples in Swift-based applications with styled output

Not Ideal For

  • Projects requiring long-term support and active maintenance due to its deprecated status
  • Real-time code editors with strict performance budgets for large files or low-latency requirements
  • Teams needing a pure Swift implementation to avoid JavaScriptCore overhead or for App Store optimization
  • Cross-platform applications targeting non-Apple ecosystems like Android or web

Pros & Cons

Pros

Broad Language Coverage

Supports 185 programming languages by leveraging highlight.js, eliminating the need to implement custom parsers for each language, as stated in the README.

Rich Theme Variety

Comes with 89 pre-built visual styles, allowing developers to easily customize syntax highlighting appearance without creating themes from scratch.

Real-time Highlighting

Provides CodeAttributedString, a subclass of NSTextStorage, enabling live syntax highlighting in text editors, which is ideal for interactive coding apps.

Automatic Language Detection

Can detect the programming language from code strings if not specified, simplifying integration for dynamic or user-submitted code snippets.

Easy Swift Integration

Offers a straightforward API to convert plain strings to NSAttributedString objects with minimal setup, using Swift Package Manager for installation.

Cons

Deprecated and Unmaintained

As of 2026, Highlightr is no longer actively maintained, with the author recommending HighlighterSwift instead, posing risks for bug fixes and compatibility updates.

JavaScript Performance Overhead

Relies on JavaScriptCore to run highlight.js, which is slower than native Swift parsers and adds runtime dependency, as admitted in the README's performance section.

Outdated highlight.js Version

The bundled highlight.js library is static and not updated, potentially missing new languages, features, or security patches from the upstream project.

Limited Ecosystem and Documentation

Lacks active community support, and documentation is hosted on Cocoadocs which may not be current, making troubleshooting difficult for new issues.

Frequently Asked Questions

Quick Stats

Stars1,859
Forks300
Contributors0
Open Issues22
Last commit2 months ago
CreatedSince 2016

Tags

#highlight#ios#ios-lib#syntax-highlighting#nsattributedstring#code-editor#mobile-development#swift#swift-library#macos

Built With

H
Highlight.js
S
Swift

Included in

iOS51.7k
Auto-fetched 1 day ago

Related Projects

YYTextYYText

Powerful text framework for iOS to display and edit rich text.

Stars8,877
Forks1,799
Last commit1 year ago
PhoneNumberKitPhoneNumberKit

A Swift framework for parsing, formatting and validating international phone numbers. Inspired by Google's libphonenumber.

Stars5,368
Forks854
Last commit11 days ago
ZSSRichTextEditorZSSRichTextEditor

A beautiful rich text WYSIWYG editor for iOS with a syntax highlighted source view

Stars3,785
Forks590
Last commit4 years ago
BonMotBonMot

Beautiful, easy attributed strings in Swift

Stars3,561
Forks196
Last commit1 year ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub