Contents

UICellAccessory

An accessory in a collection view list cell.

Declaration

@interface UICellAccessory : NSObject

Overview

A cell accessory is a visual element that you can add to a list cell (UICollectionViewListCell). You use a cell accessory as a visual indicator or to let a user perform a cell-specific action like selecting, reordering, or deleting the cell. A cell accessory appears either on the leading or the trailing edge of a cell, outside of the cell’s content view.

UIKit defines a set of standard system cell accessories. System accessories have default system-defined appearances, but you can make some customizations to them, like setting a custom tint color. You can’t customize the placement of system accessories. If you want additional customization, you can create a custom accessory with UICellAccessoryCustomView.

You add accessories to a list cell by setting its accessories array.

UICellAccessoryDisclosureIndicator *disclosure = [[UICellAccessoryDisclosureIndicator alloc] init];
[disclosure setTintColor:[UIColor systemGrayColor]];

[cell setAccessories: @[ [[UICellAccessoryCheckmark alloc] init],
                         disclosure,
                         [[UICellAccessoryDelete alloc] init],
                         [[UICellAccessoryReorder alloc] init]
                      ]];

Topics

Creating a cell accessory

Creating a system accessory

Creating a custom accessory

Customizing appearance

Customizing layout and placement

See Also

Managing cell accessories