TextBuffer

main

Swift text buffer abstraction to perform TextKit-like mutations and cursor movement.
CleanCocoa/TextBuffer

TextBuffer

Build Status Platforms Documentation

Text buffer abstractions to power your text editor, in UI or in memory.

Goals

  • In-memory text mutations with an API similar to text views.
  • Consistent behavior across platforms.

Approach

We operate on the abstraction of a Buffer to perform changes.

This enables usage of the declarative API on multiple buffers at once without having to put the text into a UI component to render.

A NSTextView is a buffer. You can use this declarative API to make changes to text views on screen.

You can also use purely in-memory buffers for text mutations of things you don't want to render. This allows you to read multiple files into buffers in your app and use the declarative API to change their contents, while only rendering a single selected file in a text view.

This is harnessed by DeclarativeTextKit.

License

Copyright © 2025 Christian Tietze. All rights reserved. Distributed under the MIT License.

See the LICENSE file.

Description

  • Swift Tools 5.9.0
View More Packages from this Author

Dependencies

  • None
Last updated: Mon May 12 2025 15:54:13 GMT-0900 (Hawaii-Aleutian Daylight Time)