Component Name | Class Name | Description |
Gift Selection Panel | GiftListView | Shows the available gifts and handles user selection and sending actions. |
Gift Animation Display | GiftPlayView | Receives gift messages and renders animations (e.g., SVGA) on screen. |
Gift Panel | Live Comment Gifts | Full-Screen Gifts |
![]() | ![]() | ![]() |
GiftListView component and add it to your view:import TUILiveKitclass YourGiftViewController: UIViewController {// 1. Create GiftListView object// - roomId: Should match the roomId of the live stream the audience has joinedlazy var giftListView = {let view = GiftListView(roomId: liveId)return view}()private let liveId: String// ... additional code ...public override func viewDidLoad() {super.viewDidLoad()// 2. Add the component to your view and set up the layoutview.addSubView(giftListView)giftPlayView.snp.remakeConstraints { make inmake.leading.trailing.equalToSuperview()make.height.equalTo(256)make.bottom.equalToSuperview()}}}
GiftPlayView component automatically receives gift messages and plays the corresponding animations. Use the sample code below to create the GiftPlayView component and add it to your view:import TUILiveKit// YourAnchorViewController represents your host view controller. Audience side can refer to the following example:class YourAnchorViewController: UIViewController {// 1. Create and initialize GiftPlayView object// - roomId: Should match the roomId of the live stream the audience has joinedlazy var giftPlayView = {let view = GiftPlayView(roomId: liveId)return view}()private let liveId: String// ... other code ...public override func viewDidLoad() {super.viewDidLoad()// 2. Add the component to your view and set up the layoutview.addSubView(giftPlayView)giftPlayView.snp.remakeConstraints { make inmake.edges.equalToSuperview()}}}
Feedback