Skip to content

EHAlertView is a subclass of UIAlertView that allows you to use blocks instead of delegate pattern while dealing with alert view action.

Notifications You must be signed in to change notification settings

amarcadet/EHAlertView

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EHAlertView

EHAlertView is an easy to use UIAlertView subclass that allows you to avoid usage of delegate pattern while dealing with alert view action. Simply use blocks to define what should be done when the user willDismiss, clicked or didDismiss the alert.

Sample code

__block EHAlertView *alertView = [[EHAlertView alloc] initWithTitle:@"Title"
															message:@"Message"
												  cancelButtonTitle:@"Cancel"
												  otherButtonTitles:@"First", @"Second", @"Third", nil];
[alertView setClickedButtonBlock:^(NSInteger buttonIndex){
	NSLog(@"Clicked button : %d", buttonIndex);
}];
[alertView setDidDismissButtonBlock:^(NSInteger buttonIndex){
	if (buttonIndex != 0)
	{
		[self showAlertView];
	}
}];
[alertView show];
[alertView release];

About

EHAlertView is a subclass of UIAlertView that allows you to use blocks instead of delegate pattern while dealing with alert view action.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published