A customizable iOS text view with advanced text selection, expansion, and scrolling capabilities.
SelectableTextView is an iOS library that provides a customizable text view component with advanced text selection and expansion capabilities. It solves the problem of limited text selection support in standard UIKit components like UILabel and UITextView by offering a flexible validator-based API for defining selectable regions and managing expandable content.
iOS developers building apps that require interactive text elements, such as social media apps with tappable hashtags, reading apps with expandable content, or any application needing custom text selection behavior beyond UIKit's defaults.
Developers choose SelectableTextView for its extensive customization options, prebuilt validators for common use cases, and seamless integration with Interface Builder, making it easier to implement complex text interactions without reinventing the wheel.
A text view that supports selection and expansion
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Offers deep customization for fonts, colors, alignment, insets, and truncation modes, with many properties configurable directly in Interface Builder via @IBDesignable.
Includes validators for common patterns like hashtags, mentions, emails, and regex, reducing boilerplate code for interactive text elements.
Provides configurable expand/collapse buttons to manage long text content, with customizable states and visual attributes for seamless UI integration.
Uses protocols like TextSelectionValidator for text validation, allowing developers to compose complex custom selection logic with abstract validators.
The README admits goals for character wrapping and more truncation styles (.head, .center) that are not yet implemented, limiting text display options.
Creating custom validators requires implementing multiple protocols and understanding validator composition, which can be complex for straightforward use cases.
While there are examples and a wiki, the documentation for edge cases and advanced customizations may be sparse, relying on developer experimentation.