TestsTested | ✗ |
LangLanguage | Obj-CObjective C |
License | MIT |
ReleasedLast Release | Jul 2015 |
Maintained by Milan Panchal.
Show Custom AlertView on UIVIew/UIWindow
Pretty simple. Just download or clone in Desktop. Drag and drop Source and Resources folder in your project. After that, add following statement wherever you wish to add.
#import <SAMAlertView.h> /*If you added via cocoapods*/
#import "SAMAlertView.h" /*If you added manually*/
SAMAlertView *alertView = [SAMAlertView alertWithTitle:@"Your Custom Alert Title" message:@"Your custom message will appear here!"];
[alertView setButtonTitles:@[@"CANCEL",@"ADD"]];
[alertView setButtonColors:@[COLOR_RGBA(232, 234, 234, 1), COLOR_RGBA(65, 150, 241, 1)]];
[alertView setButtonTitleColors:@[COLOR_RGBA(145, 145, 145, 1), COLOR_RGBA(255, 255, 255, 1)]];
[alertView setButtonImages:@[IMAGE_CROSS_ICON,IMAGE_ADD_ICON]];
[alertView setCustomButtonAlignment:CustomButtonAlignmentHorizontal];
//[alertView setCustomButtonAlignment:CustomButtonAlignmentVertical];
[alertView setOnButtonTouchUpInside:^(SAMAlertView *alertView, int buttonIndex) {
NSLog(@"Block: Button at position %d is clicked on alertView %ld.", buttonIndex, (long)[alertView tag]);
}];
[alertView show];
Horizontal Buttons
Vertical Buttons
Please feel free to contribute the project as much as you can. Planning to add more methods.
Follow me on
Twitter (@milan_panchal24)
Github (/milanpanchal)
SAMCustomAlertView is available under the MIT license. See the LICENSE file for more info.