ConfirmBox.h 831 字节
//
//  ConfirmBox.h
//  DreamSleep
//
//  Created by peter on 2022/10/19.
//

#import <UIKit/UIKit.h>

NS_ASSUME_NONNULL_BEGIN

// 确认框类型
typedef NS_ENUM(int, ConfirmBoxType) {
    ConfirmBoxTypeDynDelete, // 个人动态删除
    ConfirmBoxTypeBindMobile // 绑定手机
};

@protocol ConfirmBoxDelegate <NSObject>
@optional

/// 执行确认删除操作
/// @param indexPath indexPath
- (void)excuteDeleteAction:(NSIndexPath *)indexPath;

/// 跳转到绑定手机页面
- (void)jumpToBindMobilePage;
@end

/// 确认框
@interface ConfirmBox : UIView
@property (nonatomic, weak) id<ConfirmBoxDelegate> delegate;

- (instancetype)initWithDelegate:(id<ConfirmBoxDelegate>)delegate type:(ConfirmBoxType)type;

- (void)showConfirmBox:(NSIndexPath *)indexPath;

- (void)show;

- (void)dismiss;

@end

NS_ASSUME_NONNULL_END