Latest 0.0.3
Homepage https://github.com/HanksHu/ZLPopMenuViewController
License MIT
Platforms ios 8.0, requires ARC
Frameworks UIKit

用UIViewController实现的自定义弹出框

效果图如下

效果图

安装

  1. 使用cocoapods Podfile文件中添加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);
      }];

      欢迎大家随意改样式。

Latest podspec

{
    "name": "ZLPopMenuViewController",
    "version": "0.0.3",
    "summary": "u4e00u4e2au81eau5b9au4e49u5f39u51fau6846",
    "description": "u4e00u4e2au81eau5b9au4e49u5f39u51fa u6846",
    "homepage": "https://github.com/HanksHu/ZLPopMenuViewController",
    "license": "MIT",
    "authors": "zhilin.hu",
    "platforms": {
        "ios": "8.0"
    },
    "source": {
        "git": "https://github.com/HanksHu/ZLPopMenuViewController.git",
        "tag": "0.0.3"
    },
    "source_files": "Code/*.swift",
    "frameworks": "UIKit",
    "requires_arc": true
}

Pin It on Pinterest

Share This