Skip to content

simple wrapper for UIAlertView & UIActionSheet to support block based call back.

Notifications You must be signed in to change notification settings

brightsoftdev/DMBlockUIKit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DMBlockUIKit

simple wrapper for UIAlertView & UIActionSheet to support block based call back.

I love Blockit, because it show me the power of block.

I hate Blockit, because:

  • it crash my app
  • it isn't compitable with ios4.3
  • it use some magic which I can't understand soon.

So I implement the block based alertView & actionSheet in a simple way. the code is short and clear; even if there is something wrong, the defect should be easy to fix.

##usage

DMUIActionSheet

   DMUIActionSheet *sheet = [DMUIActionSheet actionSheetWithTitle:@"title"];
   
    [sheet addButtonWithTitle:@"button1" action:^{
        NSLog(@"button1");
    }];
    [sheet addButtonWithTitle:@"button2" action:^{
        NSLog(@"button2");
    }];
    [sheet addButtonWithTitle:@"button3" action:^{
        NSLog(@"button3");
    }];
    [sheet addButtonWithTitle:@"button4"];
    [sheet addDestructiveButtonWithTitle:@"cancel" action:^{
        NSLog(@"cancel");
    }];
   [sheet showInView:self.view];

DMUIAlertView:

    DMUIAlertView *alert = [DMUIAlertView alertViewWithTitle:@"title" message:@"message"];
    [alert addButtonWithTitle:@"button1" action:^{
        NSLog(@"button1");
    }];
    
    [alert addButtonWithTitle:@"button2"];
    [alert show];

About

simple wrapper for UIAlertView & UIActionSheet to support block based call back.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published