Code Monkey home page Code Monkey logo

xyrearrangecell's Introduction

XYRearrangeCell

  • 简单实现:拖动cell时对其重新排列位置(适用collectionView和tableView)

image

Features(特征)

  • 在不影响原有类的情况下,直接调用UIView的1个分类方法即可实现:长按cell拖动时对其进行重新排列

  • 支持collectionView和tableView的分组和非分组样式

  • 在长按cell进行拖动时,内部会拿到当前的数据进行处理,最后通过block回调处理完成的数据给外界,外界刷新数据

  • 由于刷新的是模型数据,所以不不必担心cell循环利用问题

  • 一行代码即可实现

  • 支持iOS7以上

Usage(使用方法)

#import "UIScrollView+RollView.h"

[self.tableView xy_rollViewFormOriginalDataSourceBlock:^NSArray *{
        // 返回当前的数据给tableView内部处理
        return self.plans; 
    } newDataSourceBlock:^(NSArray *newData) {
        // 回调处理完成的数据给外界
        [self.plans removeAllObjects];
        [self.plans addObjectsFromArray:newData];
    }];

  • autoRollCellSpeed: cell拖拽到屏幕边缘时,控制其他cell的滚动速度: 数值越大滚动越快,默认为5.0, 最大为15
@property CGFloat autoRollCellSpeed;

image

xyrearrangecell's People

Contributors

tuxi avatar trappings avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.