<!--
{
  "availability" : [
    "iOS: 17.0.0 -",
    "iPadOS: 17.0.0 -",
    "macCatalyst: 17.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "TipKit",
  "identifier" : "/documentation/TipKit/TipUICollectionViewCell",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "TipKit"
    ],
    "preciseIdentifier" : "c:@M@TipKit@objc(cs)TipUICollectionViewCell"
  },
  "title" : "TipUICollectionViewCell"
}
-->

# TipUICollectionViewCell

A collection view cell that embeds a tip.

```
@MainActor @objc @preconcurrency final class TipUICollectionViewCell
```

## Overview

Use this cell to create a tip you want to display and layout as a <doc://com.apple.documentation/documentation/UIKit/UICollectionViewCell>.
To configure the content and appearance of your cell, use the [`configureTip(_:arrowEdge:actionHandler:)`](/documentation/TipKit/TipUICollectionViewCell/configureTip(_:arrowEdge:actionHandler:)) function and provide a tip along with an optional arrow edge and action handler.
Set the background color of your tip view using [`backgroundColor`](/documentation/TipKit/TipUICollectionViewCell/backgroundColor).

Adding or removing TipUICollectionViewCell is done by listening to a tip’s [`shouldDisplayUpdates`](/documentation/TipKit/Tip/shouldDisplayUpdates) or [`statusUpdates`](/documentation/TipKit/Tip/statusUpdates).

```swift
import TipKit
import UIKit

class CatTracksCollectionViewController: UIViewController, UICollectionViewDataSource {
    var collectionView: UICollectionView
    var catTracksFeatureTip = CatTracksFeatureTip()

    override func viewDidLoad() {
        super.viewDidLoad()
        collectionView.register(TipUICollectionViewCell.self, forCellWithReuseIdentifier: "TipUICollectionViewCell")
    }

    override func viewDidAppear(_ animated: Bool) {
        super.viewDidAppear(animated)

        Task { @MainActor in
            for await shouldDisplay in catTracksFeatureTip.shouldDisplayUpdates {
                collectionView.reloadData()
            }
        }
    }
    
    func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
        if section == 0 {
            return catTracksFeatureTip.shouldDisplay ? 1 : 0
        }
        return dataStore.numberOfItemsInSection(section - 1)
    }

    func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
        if let indexPath.section == 0, let catTracksTipCell = collectionView.dequeueReusableCell(withReuseIdentifier: "TipUICollectionViewCell", for: indexPath) as? TipUICollectionViewCell {
            catTracksTipCell.configureTip(catTracksFeatureTip)
            return catTracksTipCell
        }
    }
}
```

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)