A lightweight iOS library for adding, removing, and editing mentions within a UITextView.
SZMentionsSwift is a lightweight iOS library built in Swift that helps developers add mention functionality to UITextView components. It solves the problem of managing user mentions—like those in social media apps—by handling insertion, deletion, and text range adjustments automatically. The library provides customizable triggers and styling to fit various app designs.
iOS developers building apps that require user mention features, such as social networks, chat applications, or collaborative tools where users can tag others in text.
Developers choose SZMentionsSwift for its simplicity and reliability in handling mentions without the overhead of larger frameworks. It offers fine-grained control over mention behavior and styling while being easy to integrate via CocoaPods or Carthage.
Library to help handle mentions
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Automatically handles insertion, deletion, and range adjustments for mentions, as shown in the README's GIF examples where text edits trigger correct mention updates.
Uses the AttributeContainer protocol to apply separate text attributes for mentions and default text, giving developers fine-grained control over appearance without extra dependencies.
Supports Carthage and CocoaPods with clear setup via MentionsSwiftListener, and allows delegate passthrough for UITextView events, simplifying addition to existing projects.
Built with a focus on simplicity per the philosophy section, avoiding bloat and making it quick to implement for basic mention needs in iOS apps.
Specifically designed for UITextView, so it cannot be used directly with SwiftUI's TextField or other modern frameworks without complex bridging or workarounds.
Developers must implement their own mention list UI from scratch, as the library only provides logic blocks like showMentionsListWithString, increasing initial development time.
Setting up MentionsSwiftListener involves multiple required blocks and delegate handling, which can be error-prone and less intuitive compared to more opinionated libraries.