davdroman / drcellslidegesturerecognizer Goto Github PK
View Code? Open in Web Editor NEWMake your cells actionable through swipes
License: MIT License
Make your cells actionable through swipes
License: MIT License
Hey there @Dromaguirre - I know you say we have total freedom WRT a license, but unlicensed code really shouldn't end up on CocoaPods Spec repo because it means the end-user of the library is unsafe
You're welcome to close the issue to ignore.
Two good resources:
and fwiw In general I just always do either BSD/MIT
I get all sorts of errors when I download it.
-QuartzCore needs to be included.
-line 345; No visible @interface for 'NSArray' declares the selector 'firstObject'
-line 399; No visible @interface for 'PDGesturedTableView' declares the selector 'setSeparatorInset'
These things are probably because I still have xcode 4. I just changed the firstObject to objectAtIndex:0 and then commented out the setSeparatorInset line (I can't find anything in the source about seperatorInsets) and it the code still seems to work. If you don't care about it working out the box for xcode 4 users I will understand I guess.
Is it possible to disable the cell dragging feature? Also, maybe related, it appears that the (^shouldMoveCellFromIndexPathToIndexPathBlock)(NSIndexPath *, NSIndexPath *) block defined in the interface isn't implemented anywhere in the code.
Not a major issue but thought id mention it anyway - fantastic control so would be a shame if people passed it by!
When you download the demo project it comes with the two xcodeprojects (PDGesturedTableView and the cocoa pods project) but not the xcworkspace that ties them both together, so you get a missing libPods.a and a linker error when you try to compile.
Easily solved in my case by closing, running a pod install in the directory, having the cocoa pods CLI generator a workspace for me and then re-opening and building from that, but obviously if you included the workspace with the demo it would be that little bit easier!
Thanks for all your work on this control, loving it so far!
I've been thinking a lot about this library, and I've come to the decision of decoupling swiping, moving and background view features from each other in three different libraries: DRCellSlideGestureRecognizer
, DRCellMoveGestureRecognizer
and DRTableBackgroundView
.
Not only will this allow for a better comprehension and improvement of the code, but for full independency when it comes to choosing the class of both the table and the cells to be used, given that UIGestureRecognizer
will be used instead UITableView
.
I'm planning on releasing DRCellSlideGestureRecognizer
first, overwriting this repository, followed by DRCellMoveGestureRecognizer
and DRTableBackgroundView
later on.
Any thoughts about this?
Hi,
I tried the PDGesturedTableView control and am impressed so far. The only issue I have is that the didSelectRowAtIndexPath isn't being invoked. I set the table view delegate to self. Is there a way around this? Perhaps a block method I can call to handle the tap cell event?
Line 137 PDGesturedTableView.m doesn't honor the UITableViewCellStyle that is passed in. Instead, it just uses the UITableViewCellStyleDefault default style
Hi, i have noticed that the left pull action swipe swipes all the way across the screen and the right one does. is there any way to make this consistent?
When the table view is populated with enough cells that it becomes scrollable, an odd behavior occurs when dragging to reorder these cells. If the table view is scrolled all the way to the top, everything works as expected. Depending on how far down you scroll the tableview, the drag to reorder cells animation will be offset by this same distance. I noticed this issue in both the sample project and when I added PDGestureTableView to my own project.
Any clue? Sounds like the table view may be reusing the cells just removed... but the content would not be brought back at the right place. Did you ever face something like this?
In current implementation, you can only move a cell to a position in the table that's currently visible. Would it be possible to add a scrolling feature to allow you to drag a cell to a position above or below the currently visible portion of the table?
See, for example, the implementation in FMMoveTableView: https://github.com/FlorianMielke/FMMoveTableView
Hello,
I would like to help you write a CocoaPods podspec for this library, but need to make sure:
PDGesturedTableView
? As I read the code, I guessed it should work on iOS > 6.I'm managing my tableview through a NSFetchedResultsController datasource, so whenever I delete an object I'd like to reflect the views in the table, but for some reason, while I can remove the classes using deleteRowsAtIndexPaths:withRowAnimation:
successfully, it fails using removeCell:duration:completion:
. Here are the two codes I'm trying:
- (void)controller:(NSFetchedResultsController *)controller didChangeObject:(id)anObject
atIndexPath:(NSIndexPath *)indexPath forChangeType:(NSFetchedResultsChangeType)type
newIndexPath:(NSIndexPath *)newIndexPath {
PDGestureTableView *tableView = self.gesturedtableView;
if(type == NSFetchedResultsChangeDelete) {
TodoTableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath];
// Standard way
[tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:animation];
//GesturedTableView way
[tableView removeCell:cell duration:0 completion:^{
NSLog(@"Cell removed");
}];
}
}
While it doesn't crash the application, it leaves the space the cell there. It looks like I'm getting a mismatched row count between what's going on in the datasource and row:
2014-02-26 00:21:53.176 GoApp[16498:60b] *** Assertion failure in -[PDGestureTableView _endCellAnimationsWithContext:], /SourceCache/UIKit/UIKit-2935.120.3/UITableView.m:1368
2014-02-26 00:21:53.178 GoApp[16498:60b] CoreData: error: Serious application error. An exception was caught from the delegate of NSFetchedResultsController during a call to -controllerDidChangeContent:. Invalid update: invalid number of rows in section 0. The number of rows contained in an existing section after the update (7) must be equal to the number of rows contained in that section before the update (8), plus or minus the number of rows inserted or deleted from that section (0 inserted, 0 deleted) and plus or minus the number of rows moved into or out of that section (0 moved in, 0 moved out). with userInfo (null)
2014-02-26 00:21:53.489 GoApp[16498:60b] Cell removed
Any clue on how to avoid this without losing the awesome sliding of the gestured cell?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.