Giter VIP home page Giter VIP logo

skstableview's People

Contributors

sakkaras 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

skstableview's Issues

SKSTableView can not use reloadData and crash

Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[__NSArrayM objectAtIndex:]: index 0 beyond bounds for empty array'

if i set numberOfRowsInSection is empty and use self.navigationItem.rightBarButtonItem click action "collapseSubrows" to reloadData tableview and then change numberOfRowsInSection not empty return ,application crash
Error at [self.expandableCells[@(correspondingIndexPath.section)][correspondingIndexPath.row][kIsExpandedKey] boolValue];

reloadData call does not work properly

Hi,
I want to change tableview content by changing content array which fills table. When i call reloadData function i saw that section, row and subrow indexes are kept and used afterwards. Therefore selected section is displayed if it is already selected just before reloadData call. Is there anyway to clear those data?

didselectrowatIndexpath:

The subrow value is always zero for Didselectrowatindexpath. Am I missing something? or is the feature not implemented ?

Expand Single Cell at one time

Hello there, I am using this awesome library. Very very thanks for the great animation for cell subViews. I want to expand single cell at one time. As for now, I expands multiple cells. But I want, If one cell is already expanded and user taps on another cell, the already expanded cell should get collapsed.Please suggest me how to do this. Thanks

How can I adjust the sub row height?

Thanks for sharing the code, One issue I encountered is that currently all sub cells are default height, How can I adjust the sub cell height for each sub cells? Shall I rewrite the method of "- (CGFloat) tableView:(TableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath" ?

ios7 crash

When i use in IOS7. in here objc_setAssociatedObject will crash.

Crashing when clicking cell very fast.

Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Cell animation stop fraction must be greater than start fraction'

exception when scrolling and selecting ...
[self deleteRowsAtIndexPaths:totalExpandedIndexPaths withRowAnimation:UITableViewRowAnimationAutomatic];

How to delete row and subrow

I uncommented the two methods related to row deletion:
-(BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath { return YES; }
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath {

But how can I differentiate whether it is subRow to delete or not? And what is the way to call the right indexPath on tableView to delete a row?

[tblView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationFade];

Dynamically Populate Rows & Sub-rows

I like to look and feel of your design, you've done some great work.

As far as I can tell, the table is static after launch, correct?
Sure would be great if we could use your design and be able to dynamically populate rows and sub-rows.

Perhaps take advantage of NSFetchedResultsController?

Nice idea...

It is possible to set a completely UITableView in the expandable cell? I would combine this with a grouped table view.

Got wrong Indexpath when clicked Button inside SubRowAtIndexPath

Hi

i am using this control is works fins but facing one issue i have added one button in cellForSubRowAtIndexPath when i clicked button the i got wrong row and subrow below is mu code

  • (UITableViewCell *)tableView:(UITableView *)tableView cellForSubRowAtIndexPath:(NSIndexPath *)indexPath

{

UIButton btn=(UIButton)[cell.contentView viewWithTag:15];

[btn addTarget:self action:@selector(DeleteClicked:) forControlEvents:UIControlEventTouchUpInside];

}

-(void)DeleteClicked:(UIButton*)sender

{

CGPoint point=[sender convertPoint:CGPointZero toView:tbl_Preview];

indexpath=[tbl_Preview indexPathForRowAtPoint:point];

// i got wrong indexpath

}
Please help me
thanks

Auto calculate height for rows and sub-rows

Hi, i implemented the auto-heigh for rows and sub-rows.

Hope to see it on project and help other developers.

Code:

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
...
    cell.textLabel.numberOfLines = 0;
...
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForSubRowAtIndexPath:(NSIndexPath *)indexPath
{
...
    cell.textLabel.numberOfLines = 0;
...
}

- (CGFloat)tableView:(SKSTableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    NSString *item = self.contents[indexPath.section][indexPath.row][0];

    CGFloat textHeight = [self getLabelHeightForText:item andWidth:tableView.bounds.size.width];
    return textHeight + 20;
}

-(CGFloat)tableView:(SKSTableView *)tableView heightForSubRowAtIndexPath:(NSIndexPath *)indexPath
{
    NSString *item = self.contents[indexPath.section][indexPath.row][indexPath.subRow];

    CGFloat textHeight = [self getLabelHeightForText:item andWidth:tableView.bounds.size.width - 20];
    return textHeight + 20;
}

-(CGFloat)getLabelHeightForText:(NSString *)text andWidth:(CGFloat)labelWidth
{
    CGSize maximumSize = CGSizeMake(labelWidth, 10000);
    CGSize labelHeighSize = [text sizeWithFont:[UIFont systemFontOfSize:20] constrainedToSize:maximumSize lineBreakMode:UILineBreakModeTailTruncation];
    return labelHeighSize.height;
}

Wrong 'isExpanded' value in 'cellForRowAtIndexPath'?

I have a problem with 'cell.isExpanded' in my ViewController in 'cellForRowAtIndexPath' (in your example this is the 'ViewController.m').

At the beginning of my 'cellForRowAtIndexPath' method I'm asking for 'isExpanded' to do UI changes for the cell. E.g. for a test I log the value:

    SKSTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell.isExpanded) {
        NSLog(@"row %i is EXPANDED", indexPath.row);
    } else {
        NSLog(@"row %i is NOT expanded", indexPath.row);
    }

When I expand a cell with a lot of subRows and scroll the tableView I get isExpanded YES for cells that are not expanded.
I set 'shouldExpandOnlyOneCell' to YES.

You can test it when you add the log outputs in your 'ViewController.m' in 'cellForRow...'.
Is it an error on my side or do I have to do it in any other way?

Missing return some method commented

Eg:
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section { if ([_SKSTableViewDelegate respondsToSelector:@selector(tableView:heightForHeaderInSection:)]) [_SKSTableViewDelegate tableView:tableView heightForHeaderInSection:section]; return 0; }
Is that a bug?
When I uncomment that method to use, It not work. :))

Could some row be expanded initially?

Thanks for sharing the code, it is a awesome extension of UITableView. One issue I encountered is that currently all cells are not expanded when first loaded, could we specify some row be expanded initially?
I add "cell.isExpanded = YES" in the tableview:cellForRow function, it does not work.

Crash on iOS 10

in method didSelectSubRowAtIndexPath,
has an error: property 'subRow' not found on object of type 'NSIndexPath *'. So my app crash.

addIndicatorView Issue

i create my customCell
SearchResultHeaderCell : SKSTableViewCell

how can add indicatorView with its animation of skstableview cell to my custom cell ?

High CPU consumption

I have the number of subrows in table more than 5000, wen I want to collapseCurrentlyExpandedIndexPaths the UI will freeze for several seconds. everything is so good except the issue. Hope you can fixed later and update for us.Thanks.

二级或多级列表

用这个可以做多级(二级以上的列表吗?)
1
1.1
1.1.1
1.1.2
1.2
1.2.1
2
2.1
2.2
这样的数据结构

Storyboard Running Issue

I want to add this library to my project. I have dropped SKSTableViewImp folder to my project and I copy all code from the ViewController.h/m of the SKSTableView folder and paste it to mine. Also I have delegate and datasource to my TableView. It is working and I can see the data but unfortunately once I click on the cell it won't expand. Please is this a bug with the Storyboard?

Thanks.

How can I get the UITableViewCell when I use didSelectSubRowAtIndexPath

  • (void)tableView:(SKSTableView *)tableView didSelectSubRowAtIndexPath:(NSIndexPath *)indexPath
    {
    MyCustomCell *cell = (MyCustomCell *)[tableView cellForRowAtIndexPath:indexPath];
    NSLog(@"%@",NSStringFromClass([cell class]));

    [cell customMethod];

}

However the cell Calss is SKSTableViewCell . can anyone help me?

UI Freezing When Scrolling

If the number of row in table more than 10, the UI will freeze and scrolling will become so slowly, everything is so good except the issue. Hope you can fixed later and update for us.Thanks.

UI Freezing during scrolling

Once I go above 10 values and begin scrolling, the UI freezes up. Not crashing, but long lagging during scrolls. How can I fix this from happening

On click of row how to dynamically add subrows in SKSTableview

In didSelectRowAtIndexPath, i want to dynamically subrows but this code is not working.

This is my array
_arr_Alphabets = [[NSMutableArray alloc] initWithObjects:
@[
@[@"A",@"A1",@"A2"],
@[@"B", @"B1",@"B2"],
@[@"C", @"C1",@"C2"],
], nil];
trying to insert object a3 after a2
[[[_arr_Alphabets objectAtIndex:0] objectAtIndex:0] insertObject:@"A3" atIndex:3];

error unrecognized selector sent to instance

how to delete rows by swipe gesture

I can not delete rows by swipe gesture
How should I do ?

  • (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath
    {
    return YES;
    }

BAD_ACCESS when expanding table view cell using 64-bit iPhone

Hi - Love the control, just thought I'd share an issue that took me a while to figure out! Unfortunately I don't really know how to solve it but hopefully it'll help

When compiling with the "Standard Architectures + 64 bit" setting on my iPhone 5S, it crashes with a BAD_ACCESS exception when expanding a table view cell.

It occurs on SKSTableView.m line 705 (the objc_setAssociatedObject call in setSubRow: )

The problem, as far as I can see, is that under 64 bit architectures the subRowObj is being treated as a long instead of an int (which it is on 32 bit) as shown below

so_debug

I've changed my project settings to exclude 64 bit architectures (as in the sample app you provided) and its working fine now

Wrong Subrow Index when selected in non first row.

I set the property shouldExpandOnlyOneCell=YES;
1.Open first Row,there are threes subrows.
2.Click the second row (not subrow,there are three subrows,too)
but I got a delegate didSelectSubRowAtIndexPath:

I think ExpandOnlyOneCell,will close subrows of First row First,and calculate corresponfingIndexPath later.

so I modify the SKSTableView.m at 331
marked //NSIndexPath *currespondingIndexPath=.......
and declare this at line 287 before if(cell.isExpandable)

sorry about my poor english.

didSelectRowAtIndexPath and didSelectSubRowAtIndexPath ISSUE

First of all thanks for your hard and great work.

My first issue is once I click on the first expandable cell and then click on other cell its crash and I get this issue "unrecognized selector sent to instance 0x13f5618f0'" but if I click on other expandable cell's and again click on other cell's expandable or not it works fine. The only issue with the first cell.
It is only crashes when I add the code below with the first cell.

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{   //Isn't this way to control if it is expandable or not?
  SKSTableViewCell *cell = (SKSTableViewCell *)[tableView cellForRowAtIndexPath:indexPath];
  if (cell.isExpandable) {
      NSLog(@"YES");
  }
  else{
      [self performSegueWithIdentifier:@"123" sender:self];
  }
}

My second issue is when the row expand and I select from the sub row I get the cell name instead of the sub row name.

- (void)tableView:(SKSTableView *)tableView didSelectSubRowAtIndexPath:(NSIndexPath *)indexPath
{
  UITableViewCell *selectedCell = [_tableView cellForRowAtIndexPath:indexPath];
  _selectedCellTxt = selectedCell.textLabel.text; 
  NSLog(@"SELECTED %@", _selectedCellTxt);
}

Please I hope you can help me with this?

Error When Clicked Expandable Row While Another Row Expanded (BUG)

I set _shouldExpandOnlyOneCell=YES

when I expand i row, if clicked another expandable row tableview detect it as a subrow.

I mean correspondingIndexPath.subRow not 0 for expandable row.

Edit : Abi Türkmüşsün ya :D ben düzelttim bu sıkıntıyı, pull requestle ekledim. #50

  NSIndexPath *correspondingIndexPath = [self correspondingIndexPathForRowAtIndexPath:indexPath];

 if (correspondingIndexPath.subRow == 0)
 {          
       [_SKSTableViewDelegate tableView:tableView didSelectRowAtIndexPath:correspondingIndexPath];
 } else {
       [_SKSTableViewDelegate tableView:self didSelectSubRowAtIndexPath:correspondingIndexPath];
 }

Selection cell issue - when first & second cell are expanded

I'm encountering an issue, when I expand the first and second cell and select from the first expanded sub row cell, I get the second row name with the first selected sub row name. What I should get is the first name with first sub row name instead. How I can fix this issue?

Cant Define footer height for row

Hi!

I`m trying to separate the cells for certain amount of margin but im unable to get it working. i uncommented the delegates on the library (viewForFooterInSection and heightForFooterInSection), but doesn't do anything, Which is the best way to achieve my objective?

Thank you very much.

Cheers

subrow issue in SKSTableView

Is there anyone using SKSTableView and knows the subrow stuff ? I'm encountering the problem that in delegate method

func tableView(tableView: SKSTableView!, cellForSubRowAtIndexPath indexPath:
NSIndexPath!) -> UITableViewCell! {}
no matter how many number of subrows are returned, indexPath.subrow keeps giving me 0, which is the index of the first subrow. So the subrow cell can only fetch the first item of the given array.

Please help and thanks ahead.

[email protected]

Please check the UI performance

Please try more than 100 items, such as countries and cities, it is too slow.
Many men mentioned this problem before, you'd better take it serious.
Thank you.

Memory and CPU leak

I implement your newest version. I have some problems with the memory and cpu. In my example exist 1 section with 34 rows and every row has 9 or 10 subrows. I change in the debug navigator and see the follow issue:

  • CPU worked by 90-95%
  • at first time the memory is growing up to 250-500 MB
  • if i scroll at the end of the view, the memory is growing up to 3 GB !!!
    What can I do? Can you replicate this?

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.