Skip to content

Commit c4cb29a

Browse files
author
Jasper
committed
很多很多
1 parent 9481f92 commit c4cb29a

24 files changed

+1250
-687
lines changed

CYUtilProject/.DS_Store

0 Bytes
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
//
2+
// CYAlertView+AdditionalView.h
3+
// CYUtilProject
4+
//
5+
// Created by xn011644 on 04/05/2017.
6+
// Copyright © 2017 Charry. All rights reserved.
7+
//
8+
9+
#import "CYAlertView.h"
10+
11+
@interface CYAlertView (AdditionalView)
12+
13+
// the next two methds add view at anywhere
14+
// add view between dark transparent background and white background area
15+
- (void)addBackgroundView:(UIView *)backgroundView
16+
atPosition:(CGPoint)position;
17+
// add view on the top
18+
- (void)addGlobalView:(UIView *)view
19+
atPosition:(CGPoint)position;
20+
21+
@end
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
//
2+
// CYAlertView+AdditionalView.m
3+
// CYUtilProject
4+
//
5+
// Created by xn011644 on 04/05/2017.
6+
// Copyright © 2017 Charry. All rights reserved.
7+
//
8+
9+
#import "CYAlertView+AdditionalView.h"
10+
11+
@implementation CYAlertView (AdditionalView)
12+
13+
- (void)addBackgroundView:(UIView *)backgroundView
14+
atPosition:(CGPoint)position {
15+
16+
backgroundView.center = position;
17+
[self addSubview:backgroundView];
18+
[self sendSubviewToBack:backgroundView];
19+
}
20+
21+
- (void)addGlobalView:(UIView *)view
22+
atPosition:(CGPoint)position {
23+
24+
view.center = position;
25+
[self addSubview:view];
26+
}
27+
28+
@end

CYUtilProject/CYAlertView/CYAlertView.h

+19-9
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,14 @@
99
#import <UIKit/UIKit.h>
1010
#import "CYAlertViewAction.h"
1111

12-
// 按钮样式,在CYAlertViewStyleAlert是有效
12+
//typedef NS_ENUM(NSInteger, CYAlertViewStyle) {
13+
//
14+
// CYAlertViewStyleAlert,
15+
// CYAlertViewStyleActionSheet // not implemented
16+
//};
17+
1318
typedef NS_ENUM(NSInteger, CYAlertViewActionStyle) {
14-
19+
1520
CYAlertViewActionStyleDefault,
1621
CYAlertViewActionStyleRoundRect
1722
};
@@ -22,23 +27,28 @@ typedef NS_ENUM(NSInteger, CYAlertViewActionStyle) {
2227
@property (nonatomic, strong, readonly) NSString *message;
2328
@property (nonatomic, strong, readonly) NSString *cancelTitle;
2429

25-
//@property (nonatomic, assign) CYAlertViewStyle style;
2630
@property (nonatomic, assign, readonly) CYAlertViewActionStyle actionStyle;
2731

2832
// default NO,点击空白区域,是否dismiss
29-
@property (nonatomic, assign) BOOL dimissOnBlankAreaTapped;
33+
@property (nonatomic, assign) BOOL dismissOnBlankAreaTapped;
3034

35+
//- (instancetype)initWithTitle:(NSString *)title
36+
// message:(NSString *)message
37+
// cancelTitle:(NSString *)cancelTitle;
3138
- (instancetype)initWithTitle:(NSString *)title
3239
message:(NSString *)message
3340
cancelTitle:(NSString *)cancelTitle
34-
actionStyle:(CYAlertViewActionStyle)actionStyle
35-
customViews:(NSArray<UIView *> *)customViews
36-
actions:(NSArray<CYAlertViewAction *> *)actions;
41+
actionStyle:(CYAlertViewActionStyle)actionStyle;
42+
43+
// the next two methods add view in the white background area
44+
// add view in the white background area
45+
- (void)addMessageView:(UIView *)view;
46+
// add alert action
47+
- (void)addAction:(CYAlertViewAction *)action;
3748

3849
#pragma mark - show
3950
- (void)show;
40-
// add bottom inset distance from bottom
41-
- (void)showWithBottomInset:(CGFloat)bottomInset;
4251
- (void)dismiss;
52+
- (void)dismissAnimated:(BOOL)animated;
4353

4454
@end

0 commit comments

Comments
 (0)