Created
October 30, 2012 14:46
-
-
Save chiahsien/3980627 to your computer and use it in GitHub Desktop.
UITableView 滾到底時載入更多
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)scrollViewDidScroll:(UIScrollView *)scrollView | |
{ | |
// 或許你會有一個變數來判斷目前是否正在載入資料 | |
if (isLoading) | |
return; | |
// 判斷滾到哪裡的時候要自動載入更多,這可以依需求調整 | |
if ((scrollView.contentOffset.y > scrollView.contentSize.height - scrollView.frame.size.height * 2) && | |
// 或許你會有其他辦法來判斷是否還有更多資料可以載入 | |
(currentPage < pageCount)) | |
{ | |
// 載入更多的動作寫在這裡 | |
[self loadNextPage]; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment