Instance Method

initWithTitleVariants:image:handler:

Initializes a grid button with specified title variants, image, and action handler.

Declaration

- (instancetype)initWithTitleVariants:(NSArray<NSString *> *)titleVariants image:(UIImage *)image handler:(void (^)(CPGridButton *barButton))handler;

Parameters

titleVariants

An array of title variants for the button. Each title should be localized and ready for display to the user. When the system displays the button, it selects the title that best fits the available screen space, so arrange the variants from most to least preferred. Always include at least one title in the array.

image

The image to display on the button. If you provide an animated image, the button uses the first image in the animation sequence.

handler

The block invoked after the user taps the button.

Return Value

A newly initialized grid button.