QMUIDialogSelectionViewController
@interface QMUIDialogSelectionViewController
: QMUIDialogViewController <QMUITableViewDelegate, QMUITableViewDataSource>
支持列表选择的弹窗,通过 items
指定要展示的所有选项(暂时只支持NSString
)。默认使用单选,可通过 allowsMultipleSelection
支持多选。
单选模式下,通过 selectedItemIndex
可获取当前被选中的选项,也可在初始化完dialog后设置这个属性来达到默认值的效果。
多选模式下,通过 selectedItemIndexes
可获取当前被选中的多个选项,可也在初始化完dialog后设置这个属性来达到默认值的效果。
-
每一行的高度,如果使用了 heightForItemBlock 则该属性不生效,默认值为配置表里的 TableViewCellNormalHeight
Declaration
Objective-C
@property (nonatomic) CGFloat rowHeight;
Swift
var rowHeight: CGFloat { get set }
-
Undocumented
Declaration
Objective-C
@property(nullable, nonatomic, strong, readonly) QMUITableView *tableView
Swift
var tableView: QMUITableView? { get }
-
Undocumented
Declaration
Objective-C
@property(nullable, nonatomic, copy) NSArray <NSString *> *items
Swift
var items: [String]? { get set }
-
表示单选模式下已选中的item序号,默认为QMUIDialogSelectionViewControllerSelectedItemIndexNone。此属性与
selectedItemIndexes
互斥。Declaration
Objective-C
@property (nonatomic) NSInteger selectedItemIndex;
Swift
var selectedItemIndex: Int { get set }
-
表示多选模式下已选中的item序号,默认为nil。此属性与
selectedItemIndex
互斥。Declaration
Objective-C
@property (nonatomic, strong, nullable) NSMutableSet<NSNumber *> *selectedItemIndexes;
Swift
var selectedItemIndexes: NSMutableSet? { get set }
-
控制是否允许多选,默认为NO。
Declaration
Objective-C
@property (nonatomic) BOOL allowsMultipleSelection;
Swift
var allowsMultipleSelection: Bool { get set }
-
Undocumented
Declaration
Objective-C
@property(nullable, nonatomic, copy) void (^cellForItemBlock
Swift
var cellForItemBlock: ((QMUIDialogSelectionViewController, QMUITableViewCell, UInt) -> Void)? { get set }
-
Undocumented
Declaration
Objective-C
@property(nullable, nonatomic, copy) CGFloat (^heightForItemBlock
Swift
var heightForItemBlock: ((QMUIDialogSelectionViewController, UInt) -> CGFloat)? { get set }
-
Undocumented
Declaration
Objective-C
@property(nullable, nonatomic, copy) BOOL (^canSelectItemBlock
Swift
var canSelectItemBlock: ((QMUIDialogSelectionViewController, UInt) -> Bool)? { get set }
-
Undocumented
Declaration
Objective-C
@property(nullable, nonatomic, copy) void (^didSelectItemBlock
Swift
var didSelectItemBlock: ((QMUIDialogSelectionViewController, UInt) -> Void)? { get set }
-
Undocumented
Declaration
Objective-C
@property(nullable, nonatomic, copy) void (^didDeselectItemBlock
Swift
var didDeselectItemBlock: ((QMUIDialogSelectionViewController, UInt) -> Void)? { get set }