• Stars
    star
    264
  • Rank 155,103 (Top 4 %)
  • Language
    Swift
  • Created about 9 years ago
  • Updated over 8 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

高仿支付宝可拖拽排序编辑动画效果集合视图

WHC_CollectionViewDemo

作者:吴海超

咨询qq:712641411

目前独一无二封装最完美的网格菜单开源组件,支持用户行为习惯自定义菜单项位置和个数

(用户可长按菜单项进行排序,删除,添加,自动保存用户编辑后的状态)

同时集成最新最轻最有个性的下拉上拉刷新组件(支持自定义刷新颜色定制和刷新动画选择)

#具体使用方式请下载demo阅读里面很详细

###该组件支持参数自定义样式说明如下:

class  WHC_MenuViewParam{
    /// 缓存菜单key
    var cacheWHCMenuKey: String!;
    /// 分段标题集合
    var segmentPartTitles: [String]!;
    /// 分段图片集合
    var segmentPartImageNames: [String]!;
    /// 分段文字颜色
    var txtColor = UIColor.grayColor();
    /// 选择背景色
    var selectedBackgroundColor: UIColor!;
    /// 网格线的颜色
    var lineColor: UIColor = UIColor.lineColor();
    /// 分割视图集合
    var segmentViews: [UIView]!; // 这个属性这个版本废除不可使用
    /// 菜单视图布局方向
    var menuOrientation: WHC_MenuViewOrientation!;
    /// 每行个数
    var column = 4;
    /// 间隙
    var pading: CGFloat = 5.0;
    /// 字体大小
    var txtSize: CGFloat = 12.0;
    /// 是否能够排序
    var canSort = true;
    /// 是否能够删除
    var canDelete = true;
    /// 是否能够添加
    var canAdd = false;
    /// 是否显示页标签
    var canShowPageCtl = true;
    /// 线宽
    var lineWidth: CGFloat = 0.5;
    /// 顶部是否有线
    var isShowTopLine = true;
    /// 是否网格显示
    var isGridShow = true;
    /// 是否动态插入菜单项
    var isDynamicInsertMenuItem = false;
    /// 动态插入背景图片名称
    var insertMenuItemImageName: String!;
    /// 是否自动拉伸菜单高度
    var autoStretchHeight = false;
    /// 获取默认视图菜单配置参数
    class func getWHCMenuViewDefaultParam(titles
        titles: [String]! ,
        imageNames: [String]! ,
        cacheWHCMenuKey: String)->WHC_MenuViewParam{

        let param = WHC_MenuViewParam();
        param.segmentPartTitles = titles;
        param.segmentPartImageNames = imageNames;
        param.selectedBackgroundColor = UIColor.themeBackgroundColor();
        param.menuOrientation = .Vertical;
        param.cacheWHCMenuKey = cacheWHCMenuKey;
        return param;
    }
}

##总体运行效果

##下拉刷新运行效果

####运行效果OneStyle调用方式代码如下:

    let menuParam = WHC_MenuViewParam.getWHCMenuViewDefaultParam(titles: ["WHC","公司通知","直销客户","渠道客户","拜访管理","拜访回馈","回馈问题","销售计划","项目报备","项目跟踪","合同管理","收款管理","工作小结","请假申请","费用申请","汇总统计","发布通知","客户审核","回馈批注","小结批注","报备审核","市场推广","售后服务","费用审核","请假审批","w","h","c","吴海超","","","","iOS","Android","WP","手机","苹果","大神"], imageNames: ["icon1","icon2","icon3","icon1","icon2","icon3","icon1","icon2","icon3","icon1","icon2","icon3","icon1","icon2","icon3","icon1","icon2","icon3","icon1","icon2","icon3","icon1","icon2","icon3","icon1","icon2","icon3","icon1","icon2","icon3","icon1","icon2","icon3","icon1","icon2","icon3","icon1","icon2"], cacheWHCMenuKey: "WHC-集合菜单样式一");

    let menuView = WHC_MenuView(frame: UIScreen.mainScreen().bounds, menuViewParam: menuParam);
    menuView.delegate = self;
    self.view.addSubview(menuView);

####运行效果TwoStyle调用方式代码如下:

    self.automaticallyAdjustsScrollViewInsets = false;
    let menuParam = WHC_MenuViewParam.getWHCMenuViewDefaultParam(titles: ["WHC","公司通知","直销客户","渠道客户","拜访管理","拜访回馈","回馈问题","销售计划","项目报备","项目跟踪","合同管理","收款管理","工作小结","请假申请","费用申请","汇总统计","发布通知","客户审核","回馈批注","小结批注","报备审核","市场推广","售后服务","费用审核","请假审批","w","h","c","吴海超","","","","iOS","Android","WP","手机","苹果","大神"], imageNames: ["icon1","icon2","icon3","icon1","icon2","icon3","icon1","icon2","icon3","icon1","icon2","icon3","icon1","icon2","icon3","icon1","icon2","icon3","icon1","icon2","icon3","icon1","icon2","icon3","icon1","icon2","icon3","icon1","icon2","icon3","icon1","icon2","icon3","icon1","icon2","icon3","icon1","icon2"], cacheWHCMenuKey: "WHC-集合菜单样式二");

    menuParam.menuOrientation = .Horizontal;  // 横向布局菜单
    let menuView = WHC_MenuView(frame: CGRectMake(0, 64.0, self.view.screenWidth(), self.view.screenHeight() - 114), menuViewParam: menuParam);
    menuView.delegate = self;
    self.view.addSubview(menuView);

####运行效果ThreeStyle调用方式代码如下:

    let menuParam = WHC_MenuViewParam.getWHCMenuViewDefaultParam(titles: nil, imageNames: nil , cacheWHCMenuKey: "");
    menuParam.canDelete = false;          // 不能删除
    menuParam.canSort = false;            // 不能排序
    menuParam.isGridShow = false;         // 没有网格
    menuParam.autoStretchHeight = true;   // 自动拉伸菜单自身
    menuParam.pading = 1;                 // 间隙
    self.imageMenuView = WHC_MenuView(frame: menuView.frame, menuViewParam: menuParam);
    self.imageMenuView.delegate = self;
    self.backView.addSubview(self.imageMenuView);

    func displayCell(imagesName: [String], otherParam: AnyObject!) {
        self.imageMenuView.update(imagesName: imagesName, titles: nil);
        self.bottomView.setY(self.imageMenuView.maxY() + 1);
        self.backView.setHeight(self.bottomView.maxY());
        self.contentView.setHeight(self.backView.maxY());
        self.setHeight(self.contentView.height());
    }


    /// 下拉上拉加载更多集成方式

    override func viewDidLoad() {
        super.viewDidLoad()
        self.navigationItem.title = "WHC-集合菜单样式三";
        self.tableView.backgroundColor = UIColor.themeBackgroundColor();
        self.tableView.registerNib(UINib(nibName: kCellName, bundle: NSBundle.mainBundle()), forCellReuseIdentifier: kCellName);
        // 默认刷新动画样式
        self.tableView.whc_setRefreshStyle(refreshStyle: .AllStyle, tableViewHeight: self.view.screenHeight(), delegate: self);
        // 可修改刷新动画样式
//        self.tableView.whc_setRefreshStyle(refreshStyle: .AllStyle, refreshAnimationType: .CrossErasure, tableViewHeight: self.view.screenHeight(), delegate: self);
        // Do any additional setup after loading the view.
    }





/// 刷新代理实现
    func WHCUpRefresh(){
        dispatch_after(dispatch_time(DISPATCH_TIME_NOW, Int64(3 * NSEC_PER_SEC)), dispatch_get_main_queue(), {
        [unowned self] () -> Void in

        self.count += 1;
        if self.count > self.imagesName.count {
            self.count = self.imagesName.count;
            self.tableView.whc_setFinishedRefresh(style: .UpStyle , prompt: "所有已经加载完");
        }else {
            self.tableView.whc_setFinishedRefresh(style: .UpStyle);
        }
        self.tableView.reloadData();
        })
    }
    func WHCDownRefresh(){
        dispatch_after(dispatch_time(DISPATCH_TIME_NOW, Int64(3 * NSEC_PER_SEC)), dispatch_get_main_queue(), {
        [unowned self] () -> Void in
        self.count -= 1;
        if self.count < 1 {
            self.count = 1;
            self.tableView.whc_setFinishedRefresh(style: .DownStyle , prompt: "已经到第一页");
        }else {
            self.tableView.whc_setFinishedRefresh(style: .DownStyle);
        }
            self.tableView.reloadData();
        })
    }

####运行效果FourStyle调用方式代码如下:

    let menuParam = WHC_MenuViewParam.getWHCMenuViewDefaultParam(titles: nil, imageNames: nil, cacheWHCMenuKey: "");
    menuParam.isDynamicInsertMenuItem = true;   // 动态插入
    menuParam.insertMenuItemImageName = "add";  // 插入图片
    imageMenuView = WHC_MenuView(frame: UIScreen.mainScreen().bounds, menuViewParam: menuParam);
    imageMenuView.delegate = self;
    self.view.addSubview(imageMenuView);

//代理:

//MARK: - WHC_MenuViewDelegate
    func WHCMenuViewClickDelete(item: WHC_MenuItem) {
        self.images.removeAtIndex(item.index);
    }

    func WHCMenuViewClickInsertItem(){
        let count = kMaxPictureChoiceNumber - self.images.count;
        if count == 0 {
            let alert = UIAlertView(title: "已选择10张,如更换图片请先长按已选图片进行删除", message: nil, delegate: nil, cancelButtonTitle: "确定");
            alert.show();
        }else {
            let vc = WHC_PictureListVC(nibName: "WHC_PictureListVC", bundle: nil);
            vc.delegate = self;
            vc.maxChoiceImageNumber = count;
            self.presentViewController(UINavigationController(rootViewController: vc), animated: true, completion: nil);
        }
    }

    //MARK: - WHC_ChoicePictureVCDelegate
    func WHCChoicePictureVC(choicePictureVC: WHC_ChoicePictureVC!, didSelectedPhotoArr photoArr: [AnyObject]!) {
        if photoArr != nil {
            for (_ , image) in photoArr.enumerate() {
            self.images.append(image as! UIImage);
            }
            self.imageMenuView.insertMenuItemsImage(self.images);
        }
    }

More Repositories

1

WHC_DataModelFactory

Mac上iOS开发辅助工具,快速把json/xml数据转换生成对应模型类属性,省去麻烦手动创建,提高开发效率。Mac iOS development aid, quickly put the json/XML data transformation generates the corresponding model class attribute, save trouble created manually, improve the development efficiency.
Objective-C
1,183
star
2

WHC_AutoLayoutKit

iOS and Mac OS X platforms currently in use the fastest the simplest development to build the UI layout automatically open source library, strong dynamic layout constraint handling capacity,iOS/Mac OS X平台上使用简单动态布局约束处理能力
Objective-C
864
star
3

WHC_ModelSqliteKit

专业的ORM数据库操作开源库,线程安全,高性能模型对象存储Sqlite开源库,真正实现一行代码操作数据库,让数据库存储变得简单 Professional database storage solutions, thread safe, high-performance model object storage Sqlite open source library, realize one line of code database operation, simple database storage
Objective-C
616
star
4

WHCNetWorkKit

WHCNetWorkKit 是http网络请求开源库(支持GET/POST 文件上传 后台文件下载 UIButton UIImageView 控件设置网络图片 网络数据工具json/xml 转模型类对象 网络状态监听)
Objective-C
470
star
5

WHC_Scan

高效强大扫描分析iOS和Android项目里没有使用的类Mac开源工具,清理项目垃圾类,让项目结构干净清爽,升级维护得心应手. Efficient and powerful scanning analysis iOS and Android project no classes used in Mac open source tools, cleaning rubbish class project, make project structure clean and relaxed, upgrade maintenance
Swift
429
star
6

WHC_KeyboardManager

IOS lightweight keyboard manager, use simple and powerful, the keyboard will never block input controls. iOS轻量级的键盘管理器,使用简单功能强大,键盘再也不会挡住输入控件
Objective-C
307
star
7

WHC_ScanUnreferenceImageTool

扫描项目里没有使用的图片工具,删除没有引用的图片以减小打包体积 Scanning project does not use images in tool, delete without reference images to reduce the packaging volume
Swift
284
star
8

WHC_Model

iOS平台高效转换引擎json->model,model->json,model->Dictionary,支持模型类继承其他模型类,支持指定路径转换,不区分json的key和模型属性名称大小写,自动处理json中null
Objective-C
246
star
9

react-native-whcapp

react-native + redux whcapp Provide learning advice for learning react-native development Support: Android 5+ iOS 8.0+,一个完整的react-native app 并且带有完整的数据交互实现
JavaScript
216
star
10

WHC_-ContainerView

高仿qq未读消息拖拽和网易新闻viewpager特效集成
Objective-C
131
star
11

whc_wechat_image_edit

开源一个完整微信小程序app,已经上线了名称《节日头像生成》 主要功能:给微信头像进行编辑添加节日标签, 节日海报的制作生成
JavaScript
120
star
12

WHC_ReaderKit

轻量级小说阅读架构(简单,高效)
Swift
85
star
13

SexyJson

SexyJson is Swift5.+ json parse open source library quickly and easily, perfect supporting class and struct model, fully oriented protocol architecture, support iOS and MAC OS X
Swift
67
star
14

WHC_PageViewKit

iOS平台轻量级的PageView组件,其中TitleBar拥有30多种UI样式
Swift
60
star
15

react-native-whc-banner

A react native module to banner auto play loop component, it works on iOS and Android
JavaScript
59
star
16

WHC_Layout

Swift iOS and Mac OS X platforms currently in use the fastest the simplest development to build the UI layout automatically open source library, strong dynamic layout constraint handling capacity,iOS/Mac OS X平台上目前使用最简单开发构建UI速度最快的自动布局开源库,强悍的动态布局约束处理能力
Swift
59
star
17

WHC_GestureUnlockScreenDemo

屏幕解锁(android类型手势拖拽解锁和iphone数字键盘解锁两种类型)采用动态渐变的色彩绘制整个UI,对于想学习动态和渐变绘图的开发者很有帮助。
Objective-C
51
star
18

whc_flutter_app

flutter whcapp Provide learning advice for learning flutter development Support: Android 5+ iOS 8.0+,一个完整的flutter app 并且带有完整的数据交互实现
Dart
51
star
19

WHC_Debuger

IOS Debuger super convenient development auxiliary debugger, in a team or maintenance projects according to the UI quickly locate unknown to the Class files, and from the quick fix related bugs .iOS Debuger超方便开发辅助调试器,在团队开发或者维护未知项目根据UI快速定位到Class文件,而从快速解决相关bug
Objective-C
37
star
20

WHC_PullAndUpRefreshDemo

高仿QQ下拉水滴刷新效果
Objective-C
36
star
21

react-native-whc-loading

A react native module to show loading ui, it works on iOS and Android.
JavaScript
32
star
22

react-native-whc-calendar

A react native module to show calendar, it works on iOS and Android. 跨平台日历组件支持iOS、Android
JavaScript
28
star
23

WHC_QRCodeScan

封装系统和ZXingObjc 二维码扫描,相册图片二维码识别,二维码生成,swift版和oc版
Objective-C
27
star
24

whc-json-to-class

javascript版本json自动转换生成对应语言模型类The whc-json-to-class is the javascript plug-in that automatically converts the json string to the corresponding language model class
JavaScript
25
star
25

FunWave

FunWave is Swift4.+ simple fun wave open source component
Swift
24
star
26

react-native-whc-toast

A react native module to show toast alert, it works on iOS and Android.
JavaScript
20
star
27

WHC_PhotoCameraChoicePictureDemo

iOS从相册和相机选择图片进行封装
Objective-C
19
star
28

Flutter-NotificationCenter

A lightweight, easy-to-use notification component library that corresponds to Dart supports post notification listening for notifications and notification removal
Dart
19
star
29

WHC_NavigationControllerKit

Lightweight gesture to return framework (simple, efficient)轻量级手势返回框架(简单,高效)
Objective-C
18
star
30

react-whc-notification

A react、vue、react native module to post and observer notification, it works on React 、React-Native Vue、H5. (支持一对多发送通知消息、主要解决react、react-native、vue、h5夸组件页面之间的通信状态管理等),该组件可以用来替代Redux,Vuex进行状态管理
JavaScript
18
star
31

WHC_BannerKit

Lightweight image shuffling components (efficient, simple)轻量级的本地以及网络自动轮播器(简单,高效)
Objective-C
14
star
32

WHC_TetrisGame

oc版俄罗斯方块游戏
Objective-C
13
star
33

WHC_XMLParser

自动解析xml为字典对象
Objective-C
12
star
34

react-native-whc-grid

A react native module to show grid view, it works on iOS and Android
JavaScript
12
star
35

store

这是带有过期时间的h5数据存储组件支持sessionStorage,localStorage
JavaScript
9
star
36

WHC_DragBadgeViewDemo

仿QQ未读消息badge拖拽水滴效果
Objective-C
5
star
37

WHC_XML

自动把字典转换为xml数据
Objective-C
4
star
38

qqFrame

高仿QQ侧滑菜单框架
Objective-C
4
star
39

qqSpaceFrame

高仿QQ空间侧滑菜单高斯模糊效果
Objective-C
3
star
40

WHC_Json

自动把字典转换为json
Objective-C
3
star