加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
MLTableAlert.h 1.95 KB
一键复制 编辑 原始数据 按行查看 历史
xiexiaolong.xxl 提交于 2024-06-18 15:06 . init
//
// MLTableAlert.h
//
// Version 1.0
//
// Created by Matteo Del Vecchio on 11/12/12.
// Copyright (c) 2012 Matthew Labs. All rights reserved.
// For the complete copyright notice, read Source Code License.
//
#import <UIKit/UIKit.h>
#import <QuartzCore/QuartzCore.h>
@class MLTableAlert;
// Blocks definition for table view management
typedef NSInteger (^MLTableAlertNumberOfRowsBlock)(NSInteger section);
typedef UITableViewCell* (^MLTableAlertTableCellsBlock)(MLTableAlert *alert, NSIndexPath *indexPath);
typedef void (^MLTableAlertRowSelectionBlock)(NSIndexPath *selectedIndex);
typedef void (^MLTableAlertCompletionBlock)(void);
@interface MLTableAlert : UIView <UITableViewDataSource, UITableViewDelegate>
{
@private
NSInteger m_row;
}
@property (nonatomic, strong) UITableView *table;
@property (nonatomic, assign) CGFloat height;
@property (nonatomic, assign) BOOL cellSelected;
@property (nonatomic, strong) MLTableAlertCompletionBlock completionBlock; // Called when Cancel button pressed
@property (nonatomic, strong) MLTableAlertRowSelectionBlock selectionBlock; // Called when a row in table view is pressed
// Classe method; rowsBlock and cellsBlock MUST NOT be nil
+(MLTableAlert *)tableAlertWithTitle:(NSString *)title row:(NSInteger)row cancelButtonTitle:(NSString *)cancelBtnTitle numberOfRows:(MLTableAlertNumberOfRowsBlock)rowsBlock andCells:(MLTableAlertTableCellsBlock)cellsBlock;
// Initialization method; rowsBlock and cellsBlock MUST NOT be nil
-(id)initWithTitle:(NSString *)title row:(NSInteger)row cancelButtonTitle:(NSString *)cancelBtnTitle numberOfRows:(MLTableAlertNumberOfRowsBlock)rowsBlock andCells:(MLTableAlertTableCellsBlock)cellsBlock ;
// Allows you to perform custom actions when a row is selected or the cancel button is pressed
-(void)configureSelectionBlock:(MLTableAlertRowSelectionBlock)selBlock andCompletionBlock:(MLTableAlertCompletionBlock)comBlock;
// Show the alert
-(void)show;
-(void)dismissTableAlert;
@end
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化