UIActionSheet(BMKitAdditions) Category Reference
| Conforms to | UIActionSheetDelegate |
| Declared in | UIActionSheet+BMKitAdditions.h |
Overview
BMKit related additions to the UIActionSheet class.
This category allows to use UIActionSheet instances without the need to implement the UIActionSheetDelegate protocol anywhere. Instead of using a delegate, you can implement the actions using blocks.
It is not possible to mix and match the delegate approach and this blocks based approach. Either use a delegate or use the block based extensions provided by this category.
Tasks
Creating Action Sheets
-
– initWithTitle:Initializes the action sheet using the specified starting parameters.
Configuring Buttons
-
– addButtonWithTitle:block:Adds a custom button with a specified code block to the action sheet.
-
– addCancelButtonWithTitle:Adds a custom button to the action sheet and sets it as cancel button.
-
– addCancelButtonWithTitle:block:Adds a custom button with a specified code block to the action sheet and sets it as cancel button.
-
– addDestructiveButtonWithTitle:Adds a custom button to the action sheet and sets it as destructive button.
-
– addDestructiveButtonWithTitle:block:Adds a custom button with a specified code block to the action sheet and sets it as destructive button.
-
– buttonBlockAtIndex:Returns the code block of the button at the specified index.
Delegate Blocks
-
actionSheetClickedButtonAtIndexBlockThe code block to execute when a button is clicked on the action sheet.
property -
willPresentActionSheetBlockThe code block to execute when the action sheet is about to be presented.
property -
didPresentActionSheetBlockThe code block to execute when the action sheet is presented.
property -
actionSheetWillDismissWithButtonIndexBlockThe code block to execute when the action sheet is about to be dismissed.
property -
actionSheetDidDismissWithButtonIndexBlockThe code block to execute when the action sheet is dismissed.
property
Properties
actionSheetClickedButtonAtIndexBlock
The code block to execute when a button is clicked on the action sheet.
@property (nonatomic, copy) BMActionSheetWithButtonIndexBlock actionSheetClickedButtonAtIndexBlockDeclared In
UIActionSheet+BMKitAdditions.hactionSheetDidDismissWithButtonIndexBlock
The code block to execute when the action sheet is dismissed.
@property (nonatomic, copy) BMActionSheetWithButtonIndexBlock actionSheetDidDismissWithButtonIndexBlockDeclared In
UIActionSheet+BMKitAdditions.hactionSheetWillDismissWithButtonIndexBlock
The code block to execute when the action sheet is about to be dismissed.
@property (nonatomic, copy) BMActionSheetWithButtonIndexBlock actionSheetWillDismissWithButtonIndexBlockDeclared In
UIActionSheet+BMKitAdditions.hInstance Methods
addButtonWithTitle:block:
Adds a custom button with a specified code block to the action sheet.
- (NSInteger)addButtonWithTitle:(NSString *)title block:(BMActionSheetWithButtonIndexBlock)blockParameters
- title
The title of the new button.
- block
The code block to run when the new button is clicked.
Return Value
The index of the new button. Button indices start at 0 and increase in the order they are added.
Declared In
UIActionSheet+BMKitAdditions.haddCancelButtonWithTitle:
Adds a custom button to the action sheet and sets it as cancel button.
- (NSInteger)addCancelButtonWithTitle:(NSString *)titleParameters
- title
The title of the new button.
Return Value
The index of the new button. Button indices start at 0 and increase in the order they are added.
Declared In
UIActionSheet+BMKitAdditions.haddCancelButtonWithTitle:block:
Adds a custom button with a specified code block to the action sheet and sets it as cancel button.
- (NSInteger)addCancelButtonWithTitle:(NSString *)title block:(BMActionSheetWithButtonIndexBlock)blockParameters
- title
The title of the new button.
- block
The code block to run when the new button is clicked.
Return Value
The index of the new button. Button indices start at 0 and increase in the order they are added.
Declared In
UIActionSheet+BMKitAdditions.haddDestructiveButtonWithTitle:
Adds a custom button to the action sheet and sets it as destructive button.
- (NSInteger)addDestructiveButtonWithTitle:(NSString *)titleParameters
- title
The title of the new button.
Return Value
The index of the new button. Button indices start at 0 and increase in the order they are added.
Declared In
UIActionSheet+BMKitAdditions.haddDestructiveButtonWithTitle:block:
Adds a custom button with a specified code block to the action sheet and sets it as destructive button.
- (NSInteger)addDestructiveButtonWithTitle:(NSString *)title block:(BMActionSheetWithButtonIndexBlock)blockParameters
- title
The title of the new button.
- block
The code block to run when the new button is clicked.
Return Value
The index of the new button. Button indices start at 0 and increase in the order they are added.
Declared In
UIActionSheet+BMKitAdditions.hbuttonBlockAtIndex:
Returns the code block of the button at the specified index.
- (BMActionSheetWithButtonIndexBlock)buttonBlockAtIndex:(NSInteger)buttonIndexParameters
- buttonIndex
The index of the button. The button indices start at 0.
Return Value
The code block of the button at the index specified by buttonIndex or nil.
Declared In
UIActionSheet+BMKitAdditions.hinitWithTitle:
Initializes the action sheet using the specified starting parameters.
- (id)initWithTitle:(NSString *)titleParameters
- title
A string to display in the title area of the action sheet. Pass
nilif you do not want to display any text in the title area.
Return Value
A newly initialized action sheet.
Declared In
UIActionSheet+BMKitAdditions.h