Skip to content

UITableCell

Cell in a UITableRow.

Cells are shown horizontally in a UITableRow which in turn is shown vertically in a UITable. Cells have content, e.g. a text or an image.

widthWeight

Relative width of the cell.

A width weight specifies the relative width of the cell. When computing the absolute width of the cell, all width weights are taken into account. Consider the following example.

Cell A has a width weight of 50. Cell B has a width weight of 100. Cell C has a width wegiht of 150.

Assume that the row has an absolute width of 100. The width will be distributed among cells A, B and C. B will be double as wide as A but C will be fifty percent wider than B and three times as wide as A.

widthWeight: number

onTap

Called when the button is tapped.

Buttons cannot be tapped when the table is presented in Siri.

onTap: fn()

dismissOnTap

Whether to dismiss the table when the button is tapped.

Defaults to false.

dismissOnTap: bool

titleColor

Color of the title.

This only has an effect on cells with a title. By default the color is null, in which case an appropriate color is automatically chosen based on the theme of the app and the context the script is running in.

titleColor: Color

subtitleColor

Color of the subtitle.

This only has an effect on cells with a subtitle. By default the color is null, in which case an appropriate color is automatically chosen based on the theme of the app and the context the script is running in.

subtitleColor: Color

titleFont

Font of the title.

titleFont: Font

subtitleFont

Font of the subtitle.

subtitleFont: Font

+text

Constructs a text cell.

static text(title: string, subtitle: string): UITableCell

Constructs a new cell containing text.

Parameters

title
string
Optional title to show in the cell.

subtitle
string
Optional subtitle shown below the title.

Return value

UITableCell
Constructed cell.


+image

Constructs an image cell.

static image(image: Image): UITableCell

Constructs a new cell containing an image.

Parameters

image
Image
Image to show in the cell.

Return value

UITableCell
Constructed cell.


+imageAtURL

Constructs an image cell.

static imageAtURL(url: string): UITableCell

Constructs a new cell that loads the image at the specified URL.

Parameters

url
string
URL to image.

Return value

UITableCell
Constructed cell.


+button

Constructs a button cell.

static button(title: string): UITableCell

Constructs a new cell that contains a button. Set the onTap property to specify an action to performed when the button is tapped.

Parameters

title
string
Title of the button.

Return value

UITableCell
Constructed cell.


-leftAligned

Left aligns content.

leftAligned()

Specifies that content in the cell should be left aligned.


-centerAligned

Center aligns content.

centerAligned()

Specifies that content in the cell should be center aligned.


-rightAligned

Right aligns content.

rightAligned()

Specifies that content in the cell should be right aligned.