Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. iOS
  3. TTGTagCollectionView

TTGTagCollectionView

MITSwift

A highly customizable iOS tag collection view for displaying text or custom views in scrollable vertical or horizontal layouts with AutoLayout support.

Visit WebsiteGitHubGitHub
1.9k stars264 forks0 contributors

What is TTGTagCollectionView?

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.

Target Audience

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.

Value Proposition

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.

Overview

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

Use Cases

Best For

  • Displaying filter or category tags in a scrollable row
  • Creating dynamic label clouds with custom styling
  • Building tag-based selection interfaces with multi-select limits
  • Implementing chip collections with rich text or icons
  • Adding horizontally scrollable tag lists to table view cells
  • Designing accessible tag inputs with built-in VoiceOver support

Not Ideal For

  • Projects built with SwiftUI that prefer native declarative components over UIKit wrappers
  • Apps requiring seamless UITableViewAutomaticDimension integration without manual workarounds
  • Use cases where tags are static and non-scrollable, as UIStackView offers a lighter-weight alternative
  • Teams needing out-of-the-box Material Design or Apple-style chip components without extensive customization

Pros & Cons

Pros

Extensive Text Customization

Tags support fonts, colors, gradients, borders, shadows, and per-corner radius settings via the TTGTextTagStyle class, allowing pixel-perfect design control.

AutoLayout and Intrinsic Sizing

Provides intrinsicContentSize and preferredMaxLayoutWidth for automatic height calculation, making it easy to integrate with AutoLayout constraints without manual size calculations.

Rich Text and Accessibility

Supports NSAttributedString for advanced typography and includes built-in accessibility features with auto-detection for VoiceOver, as shown in the accessibility properties.

Dual Component Support

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.

Cons

UITableView Compatibility Issues

The README admits that UITableViewAutomaticDimension may not work in tableViewCells, requiring developers to reload the table in viewDidAppear as a workaround.

Mandatory Reload Calls

Developers must manually call reload() after adding or modifying tags, which is easy to forget and can lead to UI bugs and inconsistent states.

Dual API Overhead

Maintaining two separate classes for text and custom views adds complexity, potentially confusing developers and increasing code duplication in mixed-use scenarios.

Frequently Asked Questions

Quick Stats

Stars1,900
Forks264
Contributors0
Open Issues0
Last commit2 months ago
CreatedSince 2015

Tags

#ios#objective-c#customizable#ui#swift5#collection-view#ui-components#layout-engine#swiftui#swift#tags#autolayout#uikit

Built With

S
Swift Package Manager
U
UIKit
O
Objective-C
C
CocoaPods
S
Swift

Links & Resources

Website

Included in

iOS51.7k
Auto-fetched 1 day ago

Related Projects

TagListViewTagListView

Simple and highly customizable iOS tag list view, in Swift.

Stars2,669
Forks491
Last commit2 years ago
SFFocusViewLayoutSFFocusViewLayout

UICollectionViewLayout with focused content

Stars1,750
Forks174
Last commit8 years ago
WSTagsFieldWSTagsField

An iOS text field that represents tags, hashtags, tokens in general.

Stars1,285
Forks226
Last commit3 years ago
YNSearchYNSearch

🔍 Awesome fully customize search view like Pinterest written in Swift 5.0 + Realm support!

Stars1,182
Forks100
Last commit2 months ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub