Sumi-Interactive / SIAlertView

An UIAlertView replacement with block syntax and fancy transition styles.
MIT License
2.51k stars 424 forks source link

Add custom view support #83

Closed dereknex closed 7 years ago

dereknex commented 10 years ago

Add custom view support , how to use: - (id)initWithTitle:(NSString *)title andCustomView:(UIView *)customView;

example:

  UITextField *field = [[UITextField alloc] initWithFrame:CGRectMake(0, 0, 200, 44)];
    [field setFont:[UIFont systemFontOfSize:40.0]];
    [field setBorderStyle:UITextBorderStyleRoundedRect];
    //field.backgroundColor = [UIColor redColor];
    SIAlertView *alertView = [[SIAlertView alloc] initWithTitle:@"Custom View" andCustomView:field];
    [alertView addButtonWithTitle:@"Cancel"
                             font:nil
                            color:[UIColor orangeColor]
                             type:SIAlertViewButtonTypeCancel
                          handler:^(SIAlertView *alertView) {
                              NSLog(@"Cancel Clicked");
                          }];

    [alertView show];
}