https://github.com/jonghwanhyeon/uialertview-block
UIAlertView category to replace UIAletViewDelegate by block
https://github.com/jonghwanhyeon/uialertview-block
Last synced: 4 months ago
JSON representation
UIAlertView category to replace UIAletViewDelegate by block
- Host: GitHub
- URL: https://github.com/jonghwanhyeon/uialertview-block
- Owner: jonghwanhyeon
- License: wtfpl
- Created: 2014-08-14T08:56:50.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2014-08-20T07:31:46.000Z (almost 11 years ago)
- Last Synced: 2025-02-15T13:42:29.250Z (4 months ago)
- Language: Objective-C
- Homepage:
- Size: 156 KB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# UIAlertView+Block
UIAlertView category to replace UIAletViewDelegate by block
## Usage
[[[UIAlertView alloc] initWithTitle:@"Alert" message:@"Do you want to delete this item?"
cancelButtonTitle:@"Cancel" otherButtonTitle:@"Delete"]
showUsingBlock:^(UIAlertView *alertView, NSInteger buttonIndex) {
if (buttonIndex == 1) {
// delete
}
}];[[[UIAlertView alloc] initWithTitle:@"Alert" message:@"What do you want?"
cancelButtonTitle:@"Cancel"
otherButtonTitles:@[@"Mark as unread", @"Archive", @"Delete"]]
showUsingBlock:^(UIAlertView *alertView, NSInteger buttonIndex) {
if (buttonIndex == 1) {
// mark as unread
} else if (buttonIndex == 2) {
// archive
} else if (buttonIndex == 3) {
// delete
}
}];[[[UIAlertView alloc] initWithMessage:@"Timer done"
cancelButtonTitle:@"Okay"]
showUsingBlock:^(UIAlertView *alertView, NSInteger buttonIndex) {
// stop timer sound
}];