单军华
2018-04-20 3af69bdf381b9ab123ee6bb6ded07e06578f434a
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
//
//  QWAlertView.h
//  AlertTest
//
//  Created by jonh on 2017/10/26.
//  Copyright © 2017年 jonh. All rights reserved.
//
 
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
///弹窗模式
typedef enum{
    ///默认 从窗口正中 弹出
    QWAlertViewStyleAlert = 0,
    ///下
    QWAlertViewStyleActionSheetDown,
    ///上
    QWAlertViewStyleActionSheetTop,
    ///左
    QWAlertViewStyleActiAlertLeft,
    ///右边
    QWAlertViewStyleActiAlertRight,
    
}QWAlertViewStyle;
///关闭模式
typedef enum{
    ///触摸整个窗口 关闭 【默认】
    CloseStyleTapClose = 0,
    /// 点击关闭按钮关闭  自带【右上角 需要自己设置图片】
    CloseStyleButtonClose,
}CloseStyle;
typedef void(^showBlock)(void);;
typedef void(^dismissBlock)(void);
@interface QWAlertView : NSObject
///弹出动画完成后的 回调
@property (nonatomic, copy) showBlock showBlock;
///关闭回调
@property (nonatomic, copy) dismissBlock dismissBlock;
///关闭模式
@property (nonatomic, assign) CloseStyle closeStyle;
/// 开启或关闭 自带的 移除弹窗事件 如果关闭需要自己调用 dismiss
@property (nonatomic, assign) BOOL on;
/// 关闭按钮 图片 30*30
@property (nonatomic, strong) UIImage *closeImage;
/**  创建弹出试图 */
+ (QWAlertView *)sharedMask;
/**
 * show:withType:     弹出视图
 * @param contentView 需要弹出的视图
 * @param style       弹出模式
 */
- (void)show:(UIView *)contentView withType:(QWAlertViewStyle)style;
/**
 *  show:withType:animationFinish:dismissHandle: 弹出视图
 *  @param contentView 需要弹出的视图
 *  @param style       弹出模式
 *  @param show        弹出回调
 *  @param dismiss     消失回调
 *
 */
- (void)show:(UIView *)contentView withType:(QWAlertViewStyle)style animationFinish:(showBlock)show dismissHandle:(dismissBlock)dismiss;
/**  移除弹出视图 */
- (void)dismiss;
 
@end