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
-
actionSheetClickedButtonAtIndexBlock
The code block to execute when a button is clicked on the action sheet.
property -
willPresentActionSheetBlock
The code block to execute when the action sheet is about to be presented.
property -
didPresentActionSheetBlock
The code block to execute when the action sheet is presented.
property -
actionSheetWillDismissWithButtonIndexBlock
The code block to execute when the action sheet is about to be dismissed.
property -
actionSheetDidDismissWithButtonIndexBlock
The 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 actionSheetClickedButtonAtIndexBlock
Declared In
UIActionSheet+BMKitAdditions.h
actionSheetDidDismissWithButtonIndexBlock
The code block to execute when the action sheet is dismissed.
@property (nonatomic, copy) BMActionSheetWithButtonIndexBlock actionSheetDidDismissWithButtonIndexBlock
Declared In
UIActionSheet+BMKitAdditions.h
actionSheetWillDismissWithButtonIndexBlock
The code block to execute when the action sheet is about to be dismissed.
@property (nonatomic, copy) BMActionSheetWithButtonIndexBlock actionSheetWillDismissWithButtonIndexBlock
Declared In
UIActionSheet+BMKitAdditions.h
Instance Methods
addButtonWithTitle:block:
Adds a custom button with a specified code block to the action sheet.
- (NSInteger)addButtonWithTitle:(NSString *)title block:(BMActionSheetWithButtonIndexBlock)block
Parameters
- 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.h
addCancelButtonWithTitle:
Adds a custom button to the action sheet and sets it as cancel button.
- (NSInteger)addCancelButtonWithTitle:(NSString *)title
Parameters
- 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.h
addCancelButtonWithTitle: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)block
Parameters
- 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.h
addDestructiveButtonWithTitle:
Adds a custom button to the action sheet and sets it as destructive button.
- (NSInteger)addDestructiveButtonWithTitle:(NSString *)title
Parameters
- 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.h
addDestructiveButtonWithTitle: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)block
Parameters
- 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.h
buttonBlockAtIndex:
Returns the code block of the button at the specified index.
- (BMActionSheetWithButtonIndexBlock)buttonBlockAtIndex:(NSInteger)buttonIndex
Parameters
- 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.h
initWithTitle:
Initializes the action sheet using the specified starting parameters.
- (id)initWithTitle:(NSString *)title
Parameters
- title
A string to display in the title area of the action sheet. Pass
nil
if you do not want to display any text in the title area.
Return Value
A newly initialized action sheet.
Declared In
UIActionSheet+BMKitAdditions.h