Inherits from UITableViewCell
Declared in JSBubbleMessageCell.h

Overview

The JSBubbleMessageCell class defines the attributes and behavior of the cells that appear in JSMessagesViewController. This class includes properties and methods for setting and managing cell content.

Tasks

Properties

avatarImageView

@property (weak, nonatomic, readonly) UIImageView *avatarImageView
Discussion

Returns the image view used to display the avatar for the cell. This property may be nil if no avatar is provided.

Declared In

JSBubbleMessageCell.h

bubbleView

@property (weak, nonatomic, readonly) JSBubbleView *bubbleView
Discussion

Returns the bubble view used in the cell. JSBubbleMessageCell adds the appropriate bubble view when you create the cell with a given cell type and bubbleImageView. This property is never nil.

Declared In

JSBubbleMessageCell.h

subtitleLabel

@property (weak, nonatomic, readonly) UILabel *subtitleLabel
Discussion

Returns the label used to display the subtitle for the cell. This property may be nil if no subtitle is provided.

Declared In

JSBubbleMessageCell.h

timestampLabel

@property (weak, nonatomic, readonly) UILabel *timestampLabel
Discussion

Returns the label used to display the timestamp for the cell. This property may be nil if no timestamp is provided.

Declared In

JSBubbleMessageCell.h

Class Methods

neededHeightForBubbleMessageCellWithMessage:displaysAvatar:displaysTimestamp:

+ (CGFloat)neededHeightForBubbleMessageCellWithMessage:(id<JSMessageData>)message displaysAvatar:(BOOL)displaysAvatar displaysTimestamp:(BOOL)displaysTimestamp
Discussion

Computes and returns the minimum necessary height of a JSBubbleMessageCell needed to display its contents.

Parameters

message

An object that conforms to the JSMessageData protocol to display in the cell.

displaysAvatar

A boolean value indicating whether or not the cell displays an avatar.

displaysTimestamp

A boolean value indicating whether or not the cell displays a timestamp.

Return Value

The height required for the frame of the cell in order for the cell to display the entire contents of its subviews.

Declared In

JSBubbleMessageCell.h

Instance Methods

initWithBubbleType:bubbleImageView:message:displaysTimestamp:hasAvatar:reuseIdentifier:

- (instancetype)initWithBubbleType:(JSBubbleMessageType)type bubbleImageView:(UIImageView *)bubbleImageView message:(id<JSMessageData>)message displaysTimestamp:(BOOL)displaysTimestamp hasAvatar:(BOOL)hasAvatar reuseIdentifier:(NSString *)reuseIdentifier
Discussion

Initializes a message cell and returns it to the caller.

Parameters

type

A constant indicating a message type. @see JSBubbleMessageType for details.

bubbleImageView

An image view initialized with bubble images. The UIImageView properties image and highlightedImage must not be nil. @see JSBubbleImageViewFactory.

message

An object that conforms to the JSMessageData protocol containing the message data for the cell.

displaysTimestamp

A boolean value indicating whether or not the cell should display the date contained in message. Pass YES to display a timestamp, NO otherwise.

hasAvatar

A boolean value indicating whether or not the cell should be initialized with an avatarImageView. Pass YES to initialize with an avatar, NO otherwise.

reuseIdentifier

A string used to identify the cell object to be reused for drawing multiple rows of a JSMessagesViewController. This property must not be nil.

Return Value

An initialized JSBubbleMessageCell object or nil if the object could not be created.

Declared In

JSBubbleMessageCell.h

messageType

- (JSBubbleMessageType)messageType
Discussion

Returns a contant indicating the message type for the cell.

Return Value

A contant indicating the message type.

Declared In

JSBubbleMessageCell.h

setAvatarImageView:

- (void)setAvatarImageView:(UIImageView *)imageView
Discussion

Sets the imageView for the avatarImageView of the cell. The frame is set for you by JSBubbleMessageCell.

Parameters

imageView

An imageView containing an avatar image. The image property of the UIImageView must not be nil.

Declared In

JSBubbleMessageCell.h

setMessage:

- (void)setMessage:(id<JSMessageData>)message
Discussion

Sets the message object for the cell.

Parameters

message

An object that conforms to the JSMessageData protocol containing the message data for the cell.

Declared In

JSBubbleMessageCell.h