Inherits from UIAlertView
Declared in DTAlertView.h

Overview

Extends UIAlertView with support for blocks.

Properties

alertViewDelegate

Use the alertViewDelegate when you want to to receive UIAlertViewDelegate messages.

@property (nonatomic, DT_WEAK_PROPERTY) id<UIAlertViewDelegate> alertViewDelegate

Declared In

DTAlertView.h

Instance Methods

addButtonWithTitle:block:

Adds a button to the alert view

- (NSInteger)addButtonWithTitle:(NSString *)title block:(DTAlertViewBlock)block

Parameters

title

The title of the new button.

block

The block to execute when the button is tapped.

Return Value

The index of the new button. Button indices start at 0 and increase in the order they are added.

Declared In

DTAlertView.h

addCancelButtonWithTitle:block:

Same as above, but for a cancel button.

- (NSInteger)addCancelButtonWithTitle:(NSString *)title block:(DTAlertViewBlock)block

Parameters

title

The title of the cancel button.

block

The block to execute when the button is tapped.

Return Value

The index of the new button. Button indices start at 0 and increase in the order they are added.

Declared In

DTAlertView.h

initWithTitle:message:

  • Initializes the alert view. Add buttons and their blocks afterwards.
- (id)initWithTitle:(NSString *)title message:(NSString *)message

Parameters

title

The alert title

message

The alert message

Declared In

DTAlertView.h

setCancelBlock:

Set a block to be run on alertViewCancel:.

- (void)setCancelBlock:(DTAlertViewBlock)block

Parameters

block

The block to execute.

Declared In

DTAlertView.h