Declared in UIBarButtonItem+BlocksKit.h

Overview

Block event initialization for UIBarButtonItem.

This set of extensions has near-drop-in replacements for the standard set of UIBarButton item initializations, using a block handler instead of a target/selector.

Includes code by the following:

Warning: UIBarButtonItem is only available on a platform with UIKit.

Tasks

Instance Methods

bk_initWithBarButtonSystemItem:handler:

- (id)bk_initWithBarButtonSystemItem:(UIBarButtonSystemItem)systemItem handler:(void ( ^ ) ( id sender ))action
Discussion

Creates and returns a configured item containing the specified system item.

Parameters

systemItem

The system item to use as the item representation. One of the constants defined in UIBarButtonSystemItem.

action

The block that gets fired on the button press.

Return Value

Newly initialized item with the specified properties.

Declared In

UIBarButtonItem+BlocksKit.h

bk_initWithImage:landscapeImagePhone:style:handler:

- (id)bk_initWithImage:(UIImage *)image landscapeImagePhone:(UIImage *)landscapeImagePhone style:(UIBarButtonItemStyle)style handler:(void ( ^ ) ( id sender ))action
Discussion

Creates and returns a configured item using the specified image and style.

Parameters

image

The item’s image. If nil an image is not displayed.

landscapeImagePhone

The image to be used for the item in landscape bars in the UIUserInterfaceIdiomPhone idiom.

style

The style of the item. One of the constants defined in UIBarButtonItemStyle.

action

The block that gets fired on the button press.

Return Value

Newly initialized item with the specified properties.

Declared In

UIBarButtonItem+BlocksKit.h

bk_initWithImage:style:handler:

- (id)bk_initWithImage:(UIImage *)image style:(UIBarButtonItemStyle)style handler:(void ( ^ ) ( id sender ))action
Discussion

Creates and returns a configured item using the specified image and style.

Parameters

image

The item’s image. If nil an image is not displayed. If this image is too large to fit on the bar, it is scaled to fit The size of a toolbar and navigation bar image is 20 x 20 points.

style

The style of the item. One of the constants defined in UIBarButtonItemStyle.

action

The block that gets fired on the button press.

Return Value

Newly initialized item with the specified properties.

Declared In

UIBarButtonItem+BlocksKit.h

bk_initWithTitle:style:handler:

- (id)bk_initWithTitle:(NSString *)title style:(UIBarButtonItemStyle)style handler:(void ( ^ ) ( id sender ))action
Discussion

Creates and returns a configured item using the specified text and style.

Parameters

title

The text displayed on the button item.

style

The style of the item. One of the constants defined in UIBarButtonItemStyle.

action

The block that gets fired on the button press.

Return Value

Newly initialized item with the specified properties.

Declared In

UIBarButtonItem+BlocksKit.h