-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathPWAlertView.h
More file actions
39 lines (32 loc) · 1.51 KB
/
PWAlertView.h
File metadata and controls
39 lines (32 loc) · 1.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
//
// ProWidgets
//
// 1.0.0
//
// Created by Alan Yip on 18 Jan 2014
// Copyright 2014 Alan Yip. All rights reserved.
//
#import "header.h"
typedef void(^PWAlertViewCompletionHandler)(BOOL cancelled, NSString *firstValue, NSString *secondValue);
@interface PWAlertView : UIAlertView<UIAlertViewDelegate> {
PWAlertViewCompletionHandler _completionHandler;
}
/**
* The block completion handler.
*/
@property(nonatomic, copy) PWAlertViewCompletionHandler completionHandler;
/**
* Wrapper method for initializing an alert view with block completion handler.
*
* @param title The string that appears in the receiver’s title bar.
* @param message Descriptive text that provides more details than the title.
* @param buttonTitle The title of the button next to cancel button or nil if there is only cancel button.
* @param cancelButtonTitle The title of the cancel button or nil if there is no cancel button.
* @param defaultValue The default value of the first text field or nil if there is no default value or no text field.
* @param style The kind of alert displayed to the user.
* @param completion The block completion handler.
*
* @return Newly initialized alert view.
*/
- (instancetype)initWithTitle:(NSString *)title message:(NSString *)message buttonTitle:(NSString *)buttonTitle cancelButtonTitle:(NSString *)cancelButtonTitle defaultValue:(NSString *)defaultValue style:(UIAlertViewStyle)style completion:(PWAlertViewCompletionHandler)completion ;
@end