innovian / hvtableview Goto Github PK
View Code? Open in Web Editor NEWUITableView with expand/collapse feature (fully animatable)
License: MIT License
UITableView with expand/collapse feature (fully animatable)
License: MIT License
Hi there! Great job with this awesome subclass!!
I'm building the Example for ipad with iOS7 and iOS8 and
//perform your expand stuff (may include animation) for cell here. It will be called when the user touches a cell
-(void)tableView:(UITableView *)tableView expandCell:(UITableViewCell *)cell withIndexPath:(NSIndexPath *)indexPath
is not being called when i touch the cell, and sometimes is called when i already pressed a couple of cells. Do you know what is happening and why this method is not being called?
Thanks so much!
Its issues with HVTableView or Something related to new SDK 8.0, please help on this
table view with 2 section and with 7 elements -> when click on third cell in second section than you will see that cell is collapsed with strange effect.
It would be very useful to have a method like canExpandAtIndexPath
This way it would be possible to prevent reloading a row, that will not expand anyway.
Hi mate, Thanks for the great resource.
Currently I need to show context menu for copy content of UILabel but not able to perform that.
Any workaround?
Hi,
I'm having some trouble with HVTableView. I don't know the reason, but my tableView seems to flick every time I expand/collapse a row. The animation is very ugly.
Take a look at the image below. You can see that some rows do not have a nice animation effect.
Do you have any suggestions on how can I make it better?
Sample project:
https://github.com/hdoria/expandTableView
I have a tableviewcell configured with a view and a button sharing a corner but i would like is to either show 1.
My code is as below inside -(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath isExpanded:(BOOL)isExpanded
UIView *ratingView = (UIView *)[cell viewWithTag:3000];
UIButton *button1 = (UIButton *)[cell viewWithTag:2100];
...
if([[key objectForKey:@"rating"] isEqualToString:@"unrated"]){
[ratingView setHidden:YES];
}
else{
[ratingView setHidden:NO];
}
if(cell.tag == indexPath.row) {
int tag = 20000 * (int)indexPath.row;
button1.tag = tag + 1;
if([[key objectForKey:@"rating"] isEqualToString:@"unrated"]){
[button1 setHidden:NO];
[button1 setTitle:@"RATE" forState:UIControlStateNormal];
[button1 addTarget:self action:@selector(btnClicked:) forControlEvents:UIControlEventTouchUpInside];
}
else{
[button1 setHidden:YES];
}
}
the value inside my array for "rating"
4,6,unrated,unrated,unrated,unrated,unrated,unrated,unrated,unrated,unrated,unrated,unrated
upon first load finish, when i expand the first cell, both the view and button will show... but when expand from third item to fifth, the view is gone and left the button... my tableview is relatively small as it only cover half of the screen due to have other things in the main view. when the cell is expanded only 1 cell is visible. when i scroll to bottom and scroll back to up, the second cell become the way it should be. sometimes some cell having both view and button no show.
i want to expand collapse on just arrow view or accessory view or any custom button
Good morning!
I found a bug using this library. I tried to use the library but the function dequeueReusableCellWithIdentifier doesn't work, it always returns NIL The problem is that when I scroll down/up the app is creating new cells that are not released and the memory consumption gets very high.
Thanks!
is it possible to package this as a cocoapods library
Some of my users eperience a crash here. This normally happens, when the cell is nil. But this is not possible as tableView.dequeueReusableCell(withIdentifier: "Cell", for: indexPath)
always returns a cell. This only happens since I started using HVTableView. What could be the reason?
Here is the error message:
Fatal Exception: NSInternalInconsistencyException
UITableView (<HVTableView: 0x106088e00; baseClass = UITableView; frame = (0 0; 375 574); clipsToBounds = YES; autoresize = RM+BM; tintColor = UIExtendedSRGBColorSpace 0 0 0 0; gestureRecognizers = <NSArray: 0x1c025daf0>; layer = <CALayer: 0x1c0220440>; contentOffset: {0, 0}; contentSize: {375, 3779}; adjustedContentInset: {0, 0, 0, 0}>) failed to obtain a cell from its dataSource (<HVTableView: 0x106088e00; baseClass = UITableView; frame = (0 0; 375 574); clipsToBounds = YES; autoresize = RM+BM; tintColor = UIExtendedSRGBColorSpace 0 0 0 0; gestureRecognizers = <NSArray: 0x1c025daf0>; layer = <CALayer: 0x1c0220440>; contentOffset: {0, 0}; contentSize: {375, 3779}; adjustedContentInset: {0, 0, 0, 0}>)
I think HVTableView very well.But i use swift.And can you update for swift? Please.
I have a "+" button used to add new rows to my tableview. It's working fine. The code is something like:
self.tableView.beginUpdates()
self.tableView.insertRowsAtIndexPaths([indexPath], withRowAnimation: UITableViewRowAnimation.Automatic)
self.tableView.endUpdates()
Now, i need to insert this row and make them expanded by default. How can I do this? I'm trying this, but it does not works very well:
let cell = self.tableView.cellForRowAtIndexPath(indexPath)
self.tableView(self.tableView, expandCell: cell, withIndexPath: indexPath)
Please add the possibility to init through storyboard/xib, soon.
Thank you in advance :)
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
is not called to the HVTableViewDelegate delegate.
It's the same with:
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath isExpanded:(BOOL)isExpanded;
It's not called when a cell is expanding so you can't change the class of the cell (ie you want a custom class when collapsed and another when expanded)
If expandOnlyOneCell is set to TRUE, it works fine, no problems, able to expand a cell (but another problem occurs, please see my other issue).
If expandOnlyOneCell is set to FALSE, nothing happens at all. No cell expansions, nothing happening at all.
Please look into it.
I have used gestureRecognizer in my app. In iOS 11 gestureRecognizer prevent the calling delegate methods of collapseCell & expandCell. Is there any solution for this? Thank you.
I just want to implement viewForHeaderInSection delegate method, but it's not called.
I also found that all the delegate methods were commented, I uncommented them but I always have the same problem.
Any suggestions please ?
Thank you.
First of all, thank you very much for this, really useful.
Scenario
My workaround was to implement a
I've implemented it as follows
(void)collapseExpandedCells {
[expandedIndexPaths removeAllObjects];
selectedIndexPath = nil;
[self performSelectorOnMainThread:@selector(reloadData) withObject:nil waitUntilDone:YES];
}
Cheers,
Ege
Im trying to get it upp and running with Swift but I can't seem to get it working.
I get:
-[tableViewTest.ViewController numberOfSectionsInTableView:]: unrecognized selector sent to instance 0x7fcecc3812d0
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[tableViewTest.ViewController numberOfSectionsInTableView:]: unrecognized selector sent to instance 0x7fcecc3812d0'
So was it your plan to remove the code? HVTableView is empty after pod install.
Parameter isExpanded in CellForRowAtIndexPath: always returns NO
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath isExpanded:(BOOL)isExpanded
Even if it shows the cell as being expanded visually, it always return isExpanded = FALSE. I am unable to update my cell because of that.
Am I missing something?
when I try to use setEditing in this HVtableview, every cell can't move or change any more.
- (UITableViewCellEditingStyle)tableView:(UITableView *)tableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath
{
return UITableViewCellEditingStyleDelete;
}
- (IBAction)clickEditTable:(id)sender {
[self.tableview setEditing:YES];
}
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.