A UITableView-based component for displaying hierarchical, expandable comment threads in iOS apps.
SwiftyComments is an open-source iOS library that provides a ready-to-use UITableView component for displaying hierarchical comment threads with expand and collapse functionality. It solves the problem of building complex, nested comment interfaces—like those in Reddit or Hacker News—by handling the UI logic, indentation, and animations, allowing developers to focus on customizing the comment content and styling.
iOS developers building apps that require threaded comment sections, such as social platforms, forums, news readers, or any application with user-generated content discussions.
Developers choose SwiftyComments because it offers a production-ready, customizable component that significantly reduces development time for comment UIs. Its tight integration with UIKit, support for smooth animations, and flexibility in styling make it a robust alternative to building such systems from scratch.
UITableView based component designed to display a hierarchy of expandable/foldable comments.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Leverages UITableView to display nested comments with visual indentation and smooth expand/collapse animations, as shown in the Reddit and Hacker News GIF examples, handling complex parent-child relationships without performance hits.
Offers granular control over indentation colors, margin sizes, indicator lines, and spacing per nesting level through CommentCell properties, allowing designs similar to popular apps like Imgur or Reddit.
Provides guidance on efficient attributed string parsing to avoid lag with HTML content, recommending manual parsing over NSAttributedString's HTML option, as demonstrated in the HN example with SwiftScanner.
Integrates SwipeCellKit for customizable swipe-to-hide actions, with properties to adjust colors, text, and images, and the ability to add more actions by overriding methods, enhancing moderation features.
Built solely on UIKit and UITableView, making it incompatible with modern SwiftUI projects without complex bridging, limiting adoption in newer iOS codebases.
Requires models to conform to the AbstractComment protocol and custom view implementation for each cell, adding boilerplate code and complexity compared to more abstracted solutions.
The README admits TODOs like animation issues in iOS 11, lack of state persistence for folded replies, and need for better abstraction, indicating it's not fully polished for all edge cases.
Relies on SwipeCellKit for swipe gestures, introducing a third-party dependency that may cause conflicts, require updates, or add bloat for teams avoiding external libraries.