LPPopupListView 是 iOS 的自定义弹出表组件,用于单选或多选。
由 Luka Penger 创建 http://lukapenger.eu
如果您想使用 CocoaPods 将此组件包含为 pod,只需将以下行添加到您的 Podfile
pod "LPPopupListView"
LPPopupListView 使用 ARC (自动引用计数)。
如果您在非 ARC 项目中使用 LPPopupListView,您需要将所有 LPPopupListView 源文件的编译器标志设置为 -fobjc-arc
。
要在 Xcode 中设置编译器标志,请转到您的活动目标并选择“构建选项”选项卡。现在选择所有 LPPopupListView 源文件,按 Enter,插入 -fobjc-arc
并然后“完成”以禁用 LPPopupListView 的 ARC。
- (void)popupListView:(LPPopupListView *)popupListView didSelectIndex:(NSInteger)index;
- (void)popupListViewDidHide:(LPPopupListView *)popupListView selectedIndexes:(NSIndexSet *)selectedIndexes;
#pragma mark - LPPopupListViewDelegate
- (void)popupListView:(LPPopupListView *)popUpListView didSelectedIndex:(NSInteger)index
{
NSLog(@"popUpListView - didSelectIndex: %d", index);
}
- (void)popupListViewDidHide:(LPPopupListView *)popupListView selectedIndexes:(NSIndexSet *)selectedIndexes
{
NSLog(@"popupListViewDidHide - selectedIndexes: %@", selectedIndexes.description);
}
此代码在 MIT 许可证 的条款和条件下分发。
在 Wiki 上可以找到每个 LPPopupListView 版本的简要总结。