Giter VIP home page Giter VIP logo

hvtableview's People

Contributors

bolekhub avatar gavyaggarwal avatar parastootb avatar xerxes235 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hvtableview's Issues

Expand Cell is not Being called.

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!

useful method canExpandAtIndexPath

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.

Expand/collapse flicks my tableview

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.

untitled

Do you have any suggestions on how can I make it better?

Sample project:
https://github.com/hdoria/expandTableView

Wanted to show either a view or a button at a same location

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.

dequeueReusableCellWithIdentifier

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!

screen

cocoapod

is it possible to package this as a cocoapods library

Crash on -[UITableView _configureCellForDisplay:forIndexPath:]

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}>)

How to expand a cell programatically?

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)

-tableView:didSelectRowAtIndexPath and -tableView: cellForRowAtIndexPath: not called

- (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)

Multiple cell expansions does not work

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.

Delegate methods not called

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.

Crash - When a cell is left expanded, you update the number of rows and select a different cell

First of all, thank you very much for this, really useful.

Scenario

  • Table has 5 rows
  • You expand the 5th row
  • You reload data so the table now has 2 rows
  • You select the 1st row
  • You get a crash because it's trying to delete the previously expanded 5th row, which is out of bounds now

My workaround was to implement a

  • (void)collapseExpandedCells;
    method which I call before changing the data source of the table

I've implemented it as follows

  • (void)collapseExpandedCells {
    [expandedIndexPaths removeAllObjects];

    selectedIndexPath = nil;

    [self performSelectorOnMainThread:@selector(reloadData) withObject:nil waitUntilDone:YES];

}

Cheers,
Ege

Have you tried to implement it with swift?

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'

Class missing

So was it your plan to remove the code? HVTableView is empty after pod install.

incorrect work

Parameter isExpanded in CellForRowAtIndexPath: always returns NO

isExpanded always returns FALSE

-(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?

[self.tableview setEditing:YES] didn't work

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];
}

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.