A highly customizable iOS tag collection view for displaying text or custom views in scrollable vertical or horizontal layouts with AutoLayout support.
TTGTagCollectionView is an open-source iOS library for creating scrollable tag interfaces. It solves the problem of displaying dynamic collections of tags (like categories, filters, or labels) in a flexible, performant layout that works seamlessly with AutoLayout. Developers can use pre-styled text tags or inject custom UIViews, with full control over appearance and behavior.
iOS developers building apps that need to display lists of tags, chips, or labels, such as in filtering interfaces, category selectors, or dynamic badge displays. It's suitable for both Objective-C and Swift projects.
Developers choose TTGTagCollectionView for its deep customization options, support for both text and custom views, and AutoLayout compatibility—avoiding the need to manually calculate complex tag layouts or build similar components from scratch.
Useful for showing text or custom view tags in a vertical or horizontal scrollable view and support Autolayout at the same time. It is highly customizable that most features of the text tag can be configured. 标签流显示控件,同时支持文字或自定义View
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Tags support fonts, colors, gradients, borders, shadows, and per-corner radius settings via the TTGTextTagStyle class, allowing pixel-perfect design control.
Provides intrinsicContentSize and preferredMaxLayoutWidth for automatic height calculation, making it easy to integrate with AutoLayout constraints without manual size calculations.
Supports NSAttributedString for advanced typography and includes built-in accessibility features with auto-detection for VoiceOver, as shown in the accessibility properties.
Offers both text-based tags (TTGTextTagCollectionView) with a simple API and custom UIView tags (TTGTagCollectionView) with a data source pattern, catering to different complexity levels.
The README admits that UITableViewAutomaticDimension may not work in tableViewCells, requiring developers to reload the table in viewDidAppear as a workaround.
Developers must manually call reload() after adding or modifying tags, which is easy to forget and can lead to UI bugs and inconsistent states.
Maintaining two separate classes for text and custom views adds complexity, potentially confusing developers and increasing code duplication in mixed-use scenarios.