zekunyan/TTGTagCollectionView
53.1
Adequate · 1 October 2026
5.5k
lines of production code
Swift
with Objective-C
2
measurements over time
What this system is
TTGTags is a Swift-based iOS library for rendering customizable tag collections within collection views. It provides a modular architecture for complex layout calculations, supporting features such as text and attributed string tags, custom subviews, and various interaction patterns including selection, drag-and-drop reordering, and swipe actions. The system includes comprehensive demo applications and documentation to illustrate integration with modern iOS layout technologies like Auto Layout and SwiftUI.
How it got here
2015 — Swift migration and documentation overhaul
6 changes.
The project underwent a major migration from Objective-C to Swift, updating the core library to require iOS 16 and Swift 5.9. This period also involved a comprehensive documentation refresh, the removal of legacy Objective-C example scaffolding, and the addition of unit tests for core tag management features.
2021–2026 — Swift migration and demo expansion
12 changes.
The project underwent a comprehensive rewrite of its core library from Objective-C to Swift, introducing a modular architecture with side-effect-free layout calculation and granular styling controls. This transition was accompanied by the creation of a new Swift-based demo application and the reorganization of the existing Objective-C examples to showcase modern iOS features like SwiftUI, Auto Layout, and drag-and-drop interactions.
Features
Added Xcode workspace configuration for Swift Package Manager
A new \contents.xcworkspacedata\ file has been added to the \.swiftpm/xcode/package.xcworkspace\ directory, establishing the necessary workspace structure to support Swift Package Manager integration within Xcode.
.swiftpm · high confidence
New Objective-C demo applications for layout, attributed text, and interaction patterns
The example project has been reorganized into TTGTagOCExample, introducing a suite of new demo view controllers that showcase specific capabilities of the TTGTags library. These include TTGDemoBasicTextTagsViewController for comparing fill alignments, TTGDemoAttributedStringTagsViewController for rendering mixed fonts and attachments, and TTGDemoCustomSubviewTagsViewController for integrating custom UIView cells. Additional demos demonstrate layout integration via TTGDemoAnchorLayoutViewController and TTGDemoStackViewViewController, self-sizing behavior in TTGDemoSelfSizingViewController, and interactive features like tag reordering in TTGDemoReorderTagsViewController and swipe selection in TTGDemoSwipeSelectionTagsViewController.
Example/TTGTagOCExample/Demos · high confidence
New Swift demo application for tag layout and interaction patterns
The example app now includes a comprehensive set of Swift-based demo pages showcasing the library's capabilities, including basic text tags, custom UIView subviews, attributed string content, and various Auto Layout integrations (Anchor constraints, UIStackView, and self-sizing forms). It also demonstrates advanced interaction patterns such as horizontal scrolling with line limits, pull-to-refresh, programmatic tag selection and scrolling, per-tag styling with attachments, and drag-and-drop reordering with delete zones.
ExampleSwift/TTGTagSwiftExample/Demos · high confidence
New Swift demo application with comprehensive layout examples
The TTGTagSwiftExample project has been introduced as a new Swift-based demo application, replacing the previous Objective-C example. This app provides a complete showcase of the library's capabilities, including basic text tags, attributed strings, custom subviews, pull-to-refresh, per-tag styling, programmatic creation, tag attachments, and tags within table views. It also features dedicated demos for modern iOS layout technologies, specifically illustrating integration with Auto Layout, UIStackView, and SwiftUI, alongside support for horizontal scrolling, drag-and-drop reordering, and swipe selection.
ExampleSwift/TTGTagSwiftExample.xcodeproj · high confidence
New documentation assets and rendering tooling for TTGTagCollectionView
This change adds a suite of new visual resources for the TTGTagCollectionView library, including high-resolution architecture, concepts, and promo posters, as well as a four-part quick-start guide covering creation, styling, selection, and layout. To support these assets, a new Node.js script using Playwright is introduced to render the HTML-based posters and guides into PNG images for use in the README and documentation.
Resources · high confidence
Removals
Removal of legacy Objective-C example app scaffolding
The Objective-C example application scaffolding within the Example/TTGTagCollectionView directory has been removed. This includes the deletion of the Main.storyboard, the TTGAppDelegate, and the TTGViewController source files, indicating a shift away from this specific legacy implementation structure in the example project.
Example/TTGTagCollectionView · high confidence
Removal of the legacy Objective-C example project
The \TTGTagCollectionView.xcodeproj\ file, which defined the Objective-C-based example application and its associated test suite, has been deleted. This change removes the legacy example project structure from the repository, aligning with the library's migration to Swift.
Example/TTGTagCollectionView.xcodeproj · high confidence
Behavioural changes
Major documentation overhaul and CI cleanup
The project documentation has been significantly expanded and modernized: the English README now features a comprehensive quick-start guide, detailed API usage examples for both Swift and Objective-C, and new visual assets (promo posters, quick-start screenshots, and architecture diagrams) generated via HTML. A new Chinese README (README\_CN.md) has been added. Additionally, the legacy Travis CI configuration (.travis.yml) has been removed, and the .gitignore file has been updated to exclude modern build artifacts, Swift Package Manager caches, and Carthage builds.
(repo-wide) · high confidence
Removal of placeholder files in the Pod directory
The placeholder files \.gitkeep\ in the \Assets\ and \Classes\ directories, along with the \ReplaceMe.m\ source file, have been removed from the Pod structure. This cleanup eliminates stub content that was likely used during initial project scaffolding, leaving the directory structure ready for actual implementation.
Pod · high confidence
Renamed Objective-C example project to TTGTagOCExample
The Objective-C example project has been renamed from TTGTagCollectionView to TTGTagOCExample. This change updates the project workspace, configuration files, and localization strings to reflect the new name, ensuring consistency in the project structure.
Example/TTGTagOCExample.xcodeproj/project.xcworkspace, Example/TTGTagOCExample.xcworkspace, Example/TTGTagOCExample/en.lproj · high confidence
Renamed Objective-C example project to TTGTagOCExample
The Objective-C example project has been renamed from its previous identifier to TTGTagOCExample. This change updates the Xcode project file (project.pbxproj) to reflect the new name, ensuring that the built application bundle and test bundle are correctly identified as TTGTagOCExample.app and TTGTagOCExample\_Tests.xctest respectively. This aligns the project structure with the library's naming convention.
Example/TTGTagOCExample.xcodeproj · high confidence
Restore launch screen and update example project structure
The TTGTagOCExample project now displays a dedicated launch screen (Launch Screen.storyboard) instead of the previous Main storyboard, and the app delegate initializes the UI programmatically by setting a demo list view controller as the root. The project has been renamed from TTGTagCollectionView to TTGTagOCExample, with associated files and bundle identifiers updated to reflect this change.
Example/TTGTagOCExample · high confidence
Swift demo app with launch screens and scene-based lifecycle
The ExampleSwift/TTGTagSwiftExample location now provides a complete Swift-based demo application, replacing the previous Objective-C setup. This includes a new Xcode workspace configuration, a LaunchScreen storyboard to restore the app's initial splash screen, and a SceneDelegate that manages the application lifecycle using the modern UIScene architecture. The demo app initializes with a DemoListViewController or a ScreenshotShowcaseViewController based on launch arguments, and features a ViewController demonstrating the TextTagCollectionView with configurable styles.
ExampleSwift/TTGTagSwiftExample · high confidence
Swift rewrite of core tag layout and model architecture
The library's core has been rewritten from Objective-C to Swift, introducing a new modular architecture for tag rendering. This change replaces the previous monolithic view logic with a side-effect-free \TagCollectionLayout\ calculator that handles complex layout algorithms (including vertical/horizontal scrolling, multi-line wrapping, and alignment) and a caching system for performance. The data model is now represented by \TextTag\ objects with distinct \TextTagContent\ (plain or attributed string) and \TextTagStyle\ classes, enabling granular control over appearance such as gradient backgrounds, corner radius, and border styles. Additionally, a new \TagCollectionView\ provides a generic data-source/delegate interface for custom views, while \TextTagCollectionView\ offers a drop-in replacement for displaying text tags with support for selection, swipe selection, and drag-to-delete interactions.
Sources · high confidence
Fixes
Updated Xcode scheme configurations for the renamed TTGTagOCExample project
The Xcode project schemes have been updated to reflect the rename of the example project from TTGTagCollectionView to TTGTagOCExample. The example scheme now correctly references the TTGTagOCExample.app target and its associated tests, and the scheme file has been upgraded to Xcode 10.2 format. A new test scheme (TTGTagCollectionView\_Tests) has also been added to support running unit tests for the collection view component.
Example/TTGTagOCExample.xcodeproj/xcshareddata · high confidence
Test coverage
Added unit tests for tag layout, collection view behavior, and tag model logic; Added unit tests for tag management, drag-and-drop customization, and swipe selection.
Dependencies
Swift rewrite and iOS 16 requirement
The library has been rewritten from Objective-C to Swift (version 3.3.0), introducing a new Swift Package Manager manifest and updating the CocoaPods spec to require iOS 16.0 and Swift 5.9. The module name is now TTGTags, and the source files are located in Sources/TTGTags.
(dependencies) · high confidence
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
Score
- CAI 56 → 53 (-3.4)
- Rubric changed (rubric-2026.09.11 → rubric-2026.09.18) — scores are not directly comparable.
Lenses
- Code Health 96 → 96 (+0.0)
- Architecture 97 → 99 (+1.8)
- Maturity 66 → 66 (-0.0)
- Readiness 33 → 27 (-6.2)
- Security 100 → 100 (+0.0)
- Accessibility 69 → 69 (+0.0)
Resolved (1)
- Off-boarding risk: anonymized user #1
New (9)
- Coverage not measured — Swift suite
- Dependency hygiene PARTLY measured — SwiftPM pinning read, dependency currency NOT established
- Documentation: no project overview (README.md)
- Inconsistent factory method naming. The type TextTag has a static/class method named tag which acts as a constructor/factory. However, TextTagStringContent and TextTagAttributedStringContent use content as their factory method name. This breaks the pattern of 'Type name as factory' vs 'content as factory'.
- Inconsistent naming for lookup by ID. indexOfTag(byId:) returns an index, but the method name suggests it might return the ID or just find it. More critically, TextTagCollectionView has getTag(byId:) and indexOfTag(byId:). The prefix get is used for retrieval, but indexOf is used for index lookup. This is inconsistent with removeTag(byId:) and updateTag(byId:) which do not use get. The get prefix is generally discouraged in Swift.
- Inconsistent removal API. The collection offers three ways to remove a tag: by object identity, by index, and by ID. While distinct, the naming removeTag(byId:) vs removeTag(at:) is slightly inconsistent with remove(tag:). More importantly, remove(tag:) implies object identity, but TextTag has a tagId property. It is unclear if remove(tag:) uses the object reference or the ID. If it uses the ID, it duplicates removeTag(byId:). If it uses reference, it's inconsistent with the ID-based removal methods.
- Off-boarding risk: anonymized user #1
- Redundant equality methods with confusing semantics. Swift standard practice is a single isEqual(to:) or == operator. Providing both isEqual(Any?) (Objective-C legacy style) and isEqual(to: TextTag?) (Swift style) creates confusion about which to use and potential ambiguity in generic contexts.
- Redundant update methods. There are four update methods covering combinations of index/ID and boolean/full object. This is overly verbose. updateTag(at:with:) and updateTag(byId:with:) are nearly identical in intent, differing only in lookup key. Similarly for the selected boolean variant.
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
zekunyan/TTGTagCollectionView was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.
About this page
- The score is its most recent published measurement, taken on 1 October 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit cad737af82a91f5b013107b2cc6d9d2a0686d8bf — the exact code this score is about.
- Scored under rubric-2026.09.18 — the same rubric and the same method as every other entry in this index.
- Measured by watchdog.canine.dev using codehealth-analyzer preprod-e569280dd5e2.