ZLPopMenuViewController 0.0.3

ZLPopMenuViewController 0.0.3

HanksHu维护。



  • zhilin.hu

ZLPopMenuViewController

使用UIViewController实现的自定义弹出框

效果图如下

效果图

安装

  1. 使用cocoapodsPodfile文件,在其中添加pod 'ZLPopMenuViewController'
  2. 或者直接将代码拖到您的项目中

使用

Swift

  • viewControll中添加 import ZLPopMenuViewController
        let datas1: [ZLPopMenuModel] = [.init(itemName: "首页(4)"),
                                        .init(itemName: "首页"),
                                        .init(itemName: "确认")]
        let popVC = ZLPopMenuViewController.init(sourceView: sender, menuData: datas1)
        popVC.didClickItems = {(index, model)in
            
        }
        present(popVC, animated: true, completion: nil)

Objective-C

  • viewControll中添加 #import <ZLPopMenuViewController/ZLPopMenuViewController-Swift.h>
        ZLPopMenuModel *model = [[ZLPopMenuModel alloc]initWithItemName:@"菜单" imageName:nil];
        
        ZLPopMenuViewController *popVC =[[ZLPopMenuViewController alloc] initWithSourceView:testView
                                                                                    menuData:@[model, model, model]
                                                                                   menuStyle:ZLPopMenuStyleWhite
                                                                               popMenuConfig:[ZLPopMenuConfig default]];
        [self presentViewController:popVC animated:true completion:nil];
        
        [popVC setDidClickItems:^(NSInteger indx, ZLPopMenuModel * _Nonnull model) {
            NSLog(@"OC中点击了 %ld, %@", indx, model);
        }];

欢迎大家自由修改样式。