You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

72 lines
2.3 KiB

//
// TFAlertView.h
// TFReader
//
// Created by 谢腾飞 on 2020/12/17.
// Copyright © 2020 xtfei_2011@126.com. All rights reserved.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
// 按钮样式
typedef NS_ENUM(NSUInteger, TFAlertButtonType) {
TFAlertButtonTypeNone, // 底部无按钮
TFAlertButtonTypeSingleCancel, // 底部单一取消按钮
TFAlertButtonTypeSingleConfirm, // 底部单一确认按钮
TFAlertButtonTypeDouble // 底部双按钮
};
// 弹框消失状态
typedef NS_ENUM(NSUInteger, TFAlertViewDisappearType) {
TFAlertViewDisappearTypeNormal, // 点击按钮或弹框以外位置消失
TFAlertViewDisappearTypeConfirm, // 只能点击按钮消失
TFAlertViewDisappearTypeNever // 不可消失
};
@class TFAlertView;
typedef void(^ClickButtonBlock)(TFAlertView *view);
@interface TFAlertView : UIView
@property (nonatomic ,copy) void(^confirmButtonClickBlock)(void);
@property (nonatomic ,copy) void(^cancelButtonClickBlock)(void);
// 按钮样式
@property (nonatomic ,assign) TFAlertButtonType alertBtnType;
// 弹框消失状态
@property (nonatomic ,assign) TFAlertViewDisappearType alertDisappearType;
// 是否显示按钮分割线
@property (nonatomic ,assign) BOOL showDivider;
@property (nonatomic ,copy) NSString *alertTitle;
@property (nonatomic ,copy) NSString *alertDetailContent;
@property (nonatomic ,strong) NSMutableAttributedString *attributedStr;
@property (nonatomic ,copy) NSString *cancelTitle;
@property (nonatomic ,copy) NSString *confirmTitle;
- (void)showAlertView;
- (void)closeAlertView;
- (instancetype)initInController;
- (instancetype)initWithFrame:(CGRect)frame UNAVAILABLE_ATTRIBUTE;
/*** 子类使用变量 ***/
@property (nonatomic ,assign ,readonly) CGFloat alertViewWidth;
@property (nonatomic ,assign ,readonly) CGFloat alertViewBtnHeight;
@property (nonatomic ,strong) UIView *alertBackView;
@property (nonatomic ,strong) UIButton *closeButton;
@property (nonatomic ,strong) UIButton *confirmButton;
@property (nonatomic ,strong) UIButton *cancelButton;
@property (nonatomic ,strong) UILabel *alertTitleLabel;
@property (nonatomic ,strong) YYLabel *contentLabel;
@property (nonatomic ,strong) UIScrollView *contentScrollView;
- (void)createSubviews;
@end
NS_ASSUME_NONNULL_END