Skip to content

Commit

Permalink
update demo
Browse files Browse the repository at this point in the history
  • Loading branch information
yulingtianxia committed Jan 12, 2019
1 parent 042847a commit 3637810
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Example/TBAlertControllerDemo/ViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ - (IBAction)clickActionSheet:(UIButton *)sender {
// [addBtn addTarget:self action:@selector(addButton:) forControlEvents:UIControlEventTouchUpInside];
// self.actionSheet.customView = addBtn;

// Custom Animation Demo
TBActionButton *destructiveBtn = [self.actionSheet buttonAtIndex:self.actionSheet.destructiveButtonIndex];
destructiveBtn.animation = ^(UIImageView * _Nonnull background, UIView * _Nonnull container, void (^ _Nonnull completion)(void)) {
[UIView animateWithDuration:0.5 animations:^{
Expand All @@ -76,6 +77,7 @@ - (IBAction)clickActionSheet:(UIButton *)sender {
}];
};

// Support Block and Attributed Title
__weak __typeof(ViewController *) weakSelf = self;
[self.actionSheet addButtonWithTitle:@"支持 block" style:TBActionButtonStyleCancel handler:^(TBActionButton * _Nonnull button) {
NSLog(@"%@ %@",button.currentTitle,weakSelf.leakTest);
Expand Down

0 comments on commit 3637810

Please sign in to comment.