explaingit

ibireme/yytext

8,876Objective-CAudience · developerComplexity · 2/5Setup · easy

TLDR

YYText is an iOS Objective-C library that replaces Apple's UILabel and UITextView with richer text rendering, supporting per-word styling, inline images, tappable links, vertical text, and async rendering to keep the UI smooth.

Mindmap

mindmap
  root((YYText))
    What it does
      Rich text display
      Editable text view
      Async rendering
    Visual Features
      Custom fonts colors
      Inline images views
      Shadows borders
    Interactivity
      Tappable link ranges
      Highlight on press
      Copy paste undo
    Special Modes
      Vertical layout
      Markdown parsing
      Emoticon substitution
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Add tappable hashtag and mention highlighting to a social media feed cell in an iOS app.

USE CASE 2

Display text with inline images, animated attachments, and custom shadows inside a UILabel replacement.

USE CASE 3

Build a rich text editor with Markdown parsing and emoticon substitution on iOS.

USE CASE 4

Render vertically laid-out text for Chinese or Japanese language interfaces in an iOS app.

Tech stack

Objective-CiOSUIKit

Getting it running

Difficulty · easy Time to first run · 30min

Install via CocoaPods or add source files manually to an existing iOS Objective-C or Swift project.

License information is not described in the explanation.

In plain English

YYText is an Objective-C library for iOS that gives developers much more control over how text is displayed and edited than the built-in Apple options allow. It works as a drop-in replacement for UILabel (for displaying text) and UITextView (for editing text), so you can switch to it without rewriting your app's existing code structure. The main reason to use it is rich text: text where different words or characters can have different fonts, sizes, colors, borders, shadows, backgrounds, and other visual effects applied to specific ranges. iOS's built-in text views support some of this, but YYText extends it further with things like inner shadows, block-level borders, background borders, glyph transforms (tilting individual characters), and animated attachments. Text attachments let you embed images, regular UIView objects, or CALayer objects directly inside a line of text. The library also supports custom tap or long-press highlight ranges, so you can make specific words tappable and style them differently when pressed, which is useful for things like links or hashtags. Built-in parsers handle basic Markdown formatting and emoticon substitution. For languages like Chinese, Japanese, and Korean that can be written vertically, YYText includes vertical layout support. The library also allows text to flow around shapes using container and exclusion paths, similar to how text wraps around an image in a magazine layout. Rendering happens asynchronously to avoid blocking the main thread, which matters when displaying long documents or many labeled items at once. Copy and paste of attributed text, undo and redo in the editor, VoiceOver accessibility, and Interface Builder support are all included. The full README is longer than what was shown.

Copy-paste prompts

Prompt 1
Show me how to replace UILabel with YYLabel to display text with a custom drop shadow and colored border in Objective-C.
Prompt 2
Write code using YYText to make hashtags and @mentions tappable with a highlight style in an iOS feed.
Prompt 3
How do I embed a UIView or image inline inside a line of text using YYText attachments?
Prompt 4
Set up YYText to parse and render basic Markdown formatting inside a UILabel replacement on iOS.
Prompt 5
Implement asynchronous text rendering with YYText to avoid dropped frames when displaying a long scrolling list.
Open on GitHub → Explain another repo

← ibireme on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.