Scrolling, like WhatsApp Chat, where scrolling up, scrolling further shows “Archive chats”,

Just not getting the right search condition, but my question is: how can I achieve this tableview function, where I can scroll up, but only when I scroll further up, the line appears above the first line.

A similar function in which WhatsApp uses “Archive chats” to display, scrolling through the list of your chats, further scrolling shows you archive chats.

I am using swift 2.3

thanks

+5
source share
1 answer

You can implement the UIScrollview delegation method scrollViewDidScroll . IF you assign a tableview delegate to self or you have implemented or validated a UITableViewDelegate , then you will automatically align the UIScrollViewDelegate protocall because UITableViewDelegate implements UIScrollViewDelegate .

In scrollViewDidScroll ,

  -(void)scrollViewDidScroll:(UIScrollView *)scrollView{ UITableView *tab = (UITableView *)scrollView; if (self.yourTableView == tab) { // Detect Scroll position and add button or do whatever you want } } 
-1
source

Source: https://habr.com/ru/post/1259409/


All Articles