Skip to content
This repository has been archived by the owner on Mar 9, 2018. It is now read-only.

How to add load more button #60

Open
Alkalouti opened this issue Nov 11, 2013 · 6 comments
Open

How to add load more button #60

Alkalouti opened this issue Nov 11, 2013 · 6 comments

Comments

@Alkalouti
Copy link

First let me thank you for this great job , how can i add load more of the top off table view

@sibahota059
Copy link

I added a control like what you want (Pull to load more). Check here : https://github.com/sibahota059/SPHChatBubble

@Alkalouti
Copy link
Author

hi @sibahota059 thanks for your advice and you create great job ,but am looking for load more data same whatsapp when you load earlier messages loading data on top of the table

@sibahota059
Copy link

@Alkalouti Hi, I can understand your questioon. I did the same thing in my app. download and run my code, and try to pull the table, in console you can see load more data. you can implement your function there to get the earlier messages. add that data to Array in Descending order and Reload the tableview.

If you already tried anything like that, write the code you are trying, i can guide you.

@Alkalouti
Copy link
Author

@sibahota059 Hi, first i want to thank you .

i had finished work at load earlier message and its working successfully, but i have a small problem when reload the data the table scroll to top i want to keep the table on the same place, i add the old data in object at index 0 now i need to reload the table without scrolling .

@sibahota059
Copy link

@Alkalouti Hi, if you adding the data in index 0 , then take the user to top of the table view once the data is added to the array.

[mainTableView scrollRectToVisible:CGRectMake(0, 0, 1, 1) animated:YES];

@Alkalouti
Copy link
Author

@sibahota059 Hi, now it's work good thank you so much my friend, when i'm add at the index 0 on table view the every index have a section on table, i used this code and it's work as i need :-)
[self.TableView reloadData];
[self.TableView scrollToRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:5] atScrollPosition:UITableViewScrollPositionTop animated:NO];
thanks again for your advice .

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants