Coder Social home page Coder Social logo

pujiaxin33 / jxmovablecelltableview Goto Github PK

View Code? Open in Web Editor NEW
188.0 188.0 37.0 3.51 MB

The custom tableView which can start moving the cell with a long press gesture.

License: MIT License

Objective-C 80.57% Ruby 16.62% Swift 2.81%
move objective-c tableviewcell

jxmovablecelltableview's People

Contributors

iallenc avatar pujiaxin33 avatar wangguibin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

jxmovablecelltableview's Issues

关于内部移动数据源问题

/只有一组
[_tempDataSource exchangeObjectAtIndex:fromIndexPath.row withObjectAtIndex:toIndexPath.row];
是否应该修改成:
//只有一组
[_tempDataSource[fromIndexPath.section] exchangeObjectAtIndex:fromIndexPath.row withObjectAtIndex:toIndexPath.row];

这里还会有个问题:
如果外面的数据源只有一层数组, 则只能使用_tempDataSource,
如果外面的数据源是两层数组,则需要使用_tempDataSource[fromIndexPath.section]。
所以这里还需要做好多层数据源的判断。

不同高度cell,向上拖动问题

不同高度的cell(cell 高度超差超过100),超过一屏幕,向上拖动较低高度的cell,在tableview滚动的时候出现,滚动到高度较高cell的地方,出现不在自动滚动。一直卡在两个cell 交换的地方。

section ==1 报错

2016-09-05 16:53:07.767 NiceArticle[5318:130720] 1
2016-09-05 16:53:20.480 NiceArticle[5318:130720] 1
2016-09-05 16:53:20.493 NiceArticle[5318:130720] 1
Printing description of toIndexPath:
<NSIndexPath: 0xc000000000800016> {length = 2, path = 0 - 4}
2016-09-05 16:56:09.784 NiceArticle[5318:130720] * Terminating app due to uncaught exception 'NSRangeException', reason: '* -[**NSArrayM exchangeObjectAtIndex:withObjectAtIndex:]: index 3 beyond bounds [0 .. 0]'
* First throw call stack:
(
0 CoreFoundation 0x000000010cf3de65 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x000000010c62ddeb objc_exception_throw + 48
2 CoreFoundation 0x000000010ce83cfa -[__NSArrayM exchangeObjectAtIndex:withObjectAtIndex:] + 362
3 NiceArticle 0x000000010c120a7f -[JXMovableCellTableView jx_updateDataSourceAndCellFromIndexPath:toIndexPath:] + 191
4 NiceArticle 0x000000010c11fe77 -[JXMovableCellTableView jx_gestureChanged:] + 263
5 NiceArticle 0x000000010c120f58 -[JXMovableCellTableView jx_processEdgeScroll] + 56
6 QuartzCore 0x000000010d62aa8c _ZN2CA7Display15DisplayLinkItem8dispatchEv + 50
7 QuartzCore 0x000000010d62a956 _ZN2CA7Display11DisplayLink14dispatch_itemsEyyy + 418
8 CoreFoundation 0x000000010ce9dc84 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION
+ 20
9 CoreFoundation 0x000000010ce9d831 __CFRunLoopDoTimer + 1089
10 CoreFoundation 0x000000010ce5f241 __CFRunLoopRun + 1937
11 CoreFoundation 0x000000010ce5e828 CFRunLoopRunSpecific + 488
12 GraphicsServices 0x000000011130aad2 GSEventRunModal + 161
13 UIKit 0x000000010d749610 UIApplicationMain + 171
14 NiceArticle 0x000000010c11edcf main + 111
15 libdyld.dylib 0x000000010fad892d start + 1
16 ??? 0x0000000000000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException

多个section快速移动导致cell交换崩溃问题

*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'attempt to move both row at index path <NSIndexPath: 0xc000000000000616> {length = 2, path = 6 - 0} and <NSIndexPath: 0xc000000000000816> {length = 2, path = 8 - 0} to <NSIndexPath: 0xc000000000000716> {length = 2, path = 7 - 0}' 跟复用cell处理字符串的NSAttributedString(富文本)有关,改为异步已解决 该问题与JXMovableCellTableView无关

特定操作下tableViewl会抖动

当 tableView.rowHeight = UITableViewAutomaticDimension 时,cell从最下往上移动并移动到顶端,tableview会上下抖动,这个可以解决吗

limitContentOffsetY:方法计算错误

- (CGFloat)limitContentOffsetY:(CGFloat)targetOffsetY {
    CGFloat minContentOffsetY;
    if (@available(iOS 11.0, *)) {
        minContentOffsetY = -self.adjustedContentInset.top;
    }
    else {
        minContentOffsetY = -self.contentInset.top;
    }
    
    CGFloat maxContentOffsetY = minContentOffsetY;
    CGFloat contentSizeHeight = self.contentSize.height;
    if (@available(iOS 11.0, *)) {
        contentSizeHeight += self.adjustedContentInset.top + self.adjustedContentInset.bottom;
    }
    else {
        contentSizeHeight += self.contentInset.top + self.contentInset.bottom;
    }
    if (contentSizeHeight > self.bounds.size.height) {
        maxContentOffsetY += contentSizeHeight - self.bounds.size.height;
    }
    return MIN(maxContentOffsetY, MAX(minContentOffsetY, targetOffsetY));
}

不然在排序时,会造成奇怪的滚动

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.