Skip to content

shebinkoshy/AlertView-and-ActionSheet-for-all-iOS-version-with-handler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 

Repository files navigation

AlertView and ActionSheet for iOS 6 to iOS 10 version with action handler

<title>AlertView and ActionSheet for iOS 6 to iOS 10 version with action handler</title>

Advantages

used only native controllers

Single line code

easy to use


Disadvantage

cannot be used for complicated purposes

unable to use for alert view with textFields


How to integrate in your project? Add Singleton.h & Singleton.m in your project.

For alert view use the following method for showing alert and if you need to get the action of an alert pass actionHandler.

[[Singleton sharedInstance] showAlertWithTitle:@"alert title" message:@"alert message" arrayOfOtherButtonTitles:@[@"OK",@"1",@"2"] cancelButtonTitle:@"Cancel" presentInViewController:self actionHandler:^(NSString *buttonTitle, NSInteger buttonIndex/**For cancel, buttonIndex will be zero*/) { NSLog(@"button action %d %@",(int)buttonIndex,buttonTitle); }];

For action sheet use the following method for showing action sheet and if you need to get the action of an action sheet pass actionHandler.

      NSLog(@"button action %d %@",(int)buttonIndex,buttonTitle);
  }];```

About

AlertView and ActionSheet for iOS 6 to iOS 10 version with action handler

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published