Open-source project
tangtiancheng/DouYinComment avatar
tangtiancheng/DouYinComment

DouYinComment: Douyin style iOS UI pieces extracted from a shipped app

iOS Widget Video Gif Play Animation 1. gif视频播放小组件, 帧动画小组件, 摇摇乐小组件, 网易云iOS小组件,动态Widget,时钟组件,风扇组件,滚动照片组件; 2.抖音视频转场动画,抖音左滑push进个人主页, 评论手势拖拽效果 , 视频播放, 边下边播, 预加载, TikTok ; 3.铃声多多,上传铃声音频到库乐队(GarageBand) 4.微博主页、简书主页等。多页面嵌套列表分页滚动,上下滑动,左右滑动切换页面。类似TableView共用HeaderView悬浮,仿头条标签编辑,铃声多多音乐播放界面(豆瓣电影主页)。

716 stars117 forksObjective-CApache-2.0

At a glance

What is it?
DouYinComment is an Objective-C collection of iOS interface components built for the Ringtone app, covering a Douyin style comment drag gesture, video transition animations, nested paging with a floating header, widgets and a GarageBand ringtone exporter. It is useful as a source of small, non-invasive UI code, but it ships no releases, keeps its tutorial in Chinese, and one of its widget features no longer works on the newest Xcode.
Who is it for?
DouYinComment is worth reading and copying from if you build iOS apps and need a Douyin style comment panel, cell-to-fullscreen video transition, or a sticky header paging control without pulling a large UI kit into your project. It is the wrong dependency for teams that need versioned releases, English setup steps, or widget rotation on Xcode 26.1 with iOS 26, and the header scroll continuation behaviour is only present in the 0.0.7 archive.
Can I use it commercially?
Yes. Apache-2.0 is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 61 days ago.
What is it written in?
Mainly Objective-C, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on October 23, 2026, and from our analysis. They are not legal advice.

Editorial analysis

A bag of iOS UI pieces, not an application

DouYinComment is a collection of Objective-C components rather than a runnable product. The top-level entries are a demo folder, a podspec named TTCTool.podspec, a licence file, and two README files, one of them in English. Inside the demo the author exercises seven groups of features: animated home screen widgets, a comment gesture panel, a pan to push transition, a video playback transition, a small video player, GarageBand ringtone export, and a nested paging control with a floating header.

The origin matters for judging the code. The author states that most of these features were already used in his own app, Ringtone Duo, which he says reaches roughly 700,000 daily active users on iOS and has held a top 100 to 200 App Store ranking for years. That is the author's claim in the README rather than an independent measurement, but it explains the shape of the code: these are features that had to survive a shipped app, not demos written for a tutorial video.

It also explains the mixed quality. A project that has lived in a commercial app accumulates working pieces and uneven documentation, which is exactly what the repository looks like.

The audience is iOS developers who need a specific interaction, likely in Objective-C or in a mixed Objective-C and Swift codebase, and who would rather paste one class than adopt a large interface framework.

Two installation routes, subspecs or dragged folders

The README offers both a full pod import and per-feature subspecs, plus a manual route that has nothing to do with CocoaPods. For most features the manual route is the advertised one: the author repeatedly tells the reader to drag a single folder into the project and then add one or two lines of code. For the pan push transition the README names the folder TTCPanPushTransition, and for the video transition it names TTCTransition. The comment gesture view is described as a single class, TCCommentsPopView, that can be dropped straight into an existing project.

The pod route is available as well. The podspec is called TTCTool, and the README lists subspecs for the comment pop view, the transition, the pan push, the paging view under TCViewPage, and the tag channel manager under TagChannelManager. The full pod subspec lines in the README are annotated in Chinese, and each line pairs the Chinese feature label with the subspec path, so the subspec names are readable even if the labels are not.

For a team with an existing paging control, the manual route is the better fit. The author explains why he split TCNestScrollPageView away from TCViewPager in the first place: he wanted to add a floating header effect to his own profile page without rewriting paging code he had already shipped and without forcing users who already had their own paging control to change it. Keeping the two independent is a deliberate choice, and it lets you adopt only the sticky header part.

TCCommentsPopView reproduces the drag to open comment sheet

The comment feature is the one the author seems most protective of. He states that he searched GitHub, cocoaChina and other sites for a long time without finding a demo that matched Douyin's behaviour exactly, and that the component is already in use inside his own app. The README describes the interaction as a gesture drag effect on short videos, modelled on Douyin's comment panel, and presents the usage as unusually simple: drag TCCommentsPopView into the project and call it.

From a code review perspective, the honest read is that this is a self-contained view class rather than a framework. The README does not publish a delegate protocol, a data source interface, or a documented callback for the comment list, so the details of how comments are fetched, displayed, and paginated are in the source rather than in the description. The README does not document keyboard handling, safe area behaviour, or how the panel dismisses.

What is documented is the scope. It is a visual and gesture reproduction of a known interaction, aimed at teams that want the look without writing the animation maths. If you need a comment system with data, moderation, and pagination, this gives you the shell and nothing else.

TTCTransition grows a small cell into the full screen player

The video transition works by intercepting the transition and animating a small cell outward into a full screen playback view. The README states that other demos either did not match Douyin's behaviour or were tightly coupled and required invasive edits to existing code, and that this implementation avoids touching the original code.

The interface is small enough to describe in prose. You import TTCTransitionDelegate.h, assign a delegate instance to the view controller's ttcTransitionDelegate property, and optionally set the smalCurPlayCell property to the small cell the animation should start from. If you leave that property unset, the animation expands from the centre instead. The README says both push and present presentations are supported.

The property name is misspelled in the original, smalCurPlayCell rather than smallCurPlayCell, which matters if you search for it. The misspelling is consistent across the README and the demo, so a search for the corrected spelling will turn up nothing.

The author describes this as a one or two line integration, and the mechanism is plausible for that claim, since the delegate pattern leaves the presenting controller responsible only for returning the destination controller and the origin cell.

A block-based pan push into a profile screen

The pan push feature reproduces the Douyin gesture of swiping left to push a personal profile page. The README gives a three step procedure: drag the TTCPanPushTransition folder into the project, import UIViewController+TTCPanPush.h in the controller class that will perform the push, and call getpanPushToViewController: in viewDidLoad with a block that returns the profile view controller.

Returning the destination controller from a block rather than through a property or delegate keeps the call site to one expression, and the README's point that it does not invade the developer's existing code is accurate at the level of the call site. The category on UIViewController means the method appears on every view controller, which is convenient and also means the symbol is not obvious from the header of your own controller class.

A limitation worth flagging: the README notes the method is called in viewDidLoad, and the gesture recognizer therefore exists for the lifetime of the controller. It does not say how to disable the gesture on screens where it should not trigger, and it does not document interaction with an existing interactive pop gesture or with scroll views that also handle horizontal pans. Those are the two places this kind of category method usually collides with an existing app.

GarageBand export and the widgets that Xcode 26.1 breaks

Two smaller groups round out the collection. One is uploading audio into GarageBand so a user can set it as a phone ringtone, a niche flow the author says he researched without finding any prior documentation. The other is home screen widgets: GIF playback widgets, frame animation widgets, a shake widget, editable widgets, a fan widget, a clock widget, and a scrolling photo widget, in the spirit of the NetEase Cloud Music widget.

The widget group is where the repository runs into a hard environment limit. The README states that newer Xcode 26.1 does not support widget rotation on iOS 26, and that earlier Xcode versions worked fine. That is a compatibility statement about the host toolchain, not a bug in the sample, and it means the rotation behaviour cannot be validated on a current machine.

The video playback feature also covers progressive download while playing and video preloading, and the author himself notes that other demos for this exist and may be better. The small video player is the least differentiated part of the collection.

One more honest note: the header scroll continuation behaviour, described as implemented differently from other approaches, is not in the current code. The README points readers to the 0.0.7 archive for that implementation and says the newer version dropped it.

Apache-2.0 licence, no releases, Chinese first documentation

The project is licensed under Apache-2.0, which permits commercial use inside closed-source apps and requires attribution and notice retention in distributed copies. No legal interpretation is needed for a team that vendors a class file; the obligations attach to redistribution.

Maintenance is the murkiest part. The repository is not archived and the last push was on 2026-08-24, which is recent enough that the code is not stale in the sense of being abandoned. What is missing is any release history: the repository has no GitHub releases, no changelog, and no version tags beyond the older 0.0.7 archive the README points at for the header continuation code. Consumers who install through CocoaPods get whatever the podspec points at, and the README does not describe a version pinning or upgrade policy.

Documentation is Chinese first. An English README exists in the repository, so an English reader is not blocked, but the per-feature instructions, the animated demonstrations, and the reasoning behind the design decisions live in the Chinese file. Expect to translate intent, not just strings, when you evaluate the code.

Editorial conclusion

DouYinComment is worth reading and copying from if you build iOS apps and need a Douyin style comment panel, cell-to-fullscreen video transition, or a sticky header paging control without pulling a large UI kit into your project. It is the wrong dependency for teams that need versioned releases, English setup steps, or widget rotation on Xcode 26.1 with iOS 26, and the header scroll continuation behaviour is only present in the 0.0.7 archive. Before adopting, open TTCTool.podspec and the DouYinCComment demo target to check the deployment target, then copy the single class you need rather than linking the pod.

Frequently asked questions

How do I install DouYinComment in an iOS project?

The README offers a CocoaPods import of the TTCTool pod, or per feature subspecs such as TCCommentsPopView and TTCTransition. It also documents dragging individual folders such as TTCTransition or TTCPanPushTransition straight into the project, which is the approach the author recommends for single features.

Does the DouYinComment widget animation work on the latest Xcode?

The README states that newer Xcode 26.1 does not support widget rotation on iOS 26, while older Xcode versions had no problem. That affects the rotation behaviour of the widget examples in the demo.

Can I use TCNestScrollPageView with my own paging control?

Yes. The author deliberately split TCNestScrollPageView, which handles nested header scrolling and a floating header, away from TCViewPager, which handles paging, so that developers who already have their own paging control can add only the header floating effect.

Official sources

  1. Issues
  2. License: Apache-2.0
  3. README
  4. tangtiancheng/DouYinComment on GitHub
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/tangtiancheng-douyincomment.svg)](https://hysenlabs.com/projects/tangtiancheng-douyincomment)

Was this useful?