I saw the UIRefreshControl in iOS 6 and my question is if it is possible to refresh a WebView by pulling it down and than let it pop up like in mail? Code I used rabih is the WebView:
UIRefreshControl *refreshControl = [[UIRefreshControl alloc] init];
[refreshControl addTarget:self action:@selector(handleRefresh:) forControlEvents:UIControlEventValueChanged];
[rabih addSubview:rabih];
I've actually tried that and got error following.
I could use in UIScrollView and UICollectionView though.
This is how you can use pull down to refresh on UIWebview:
Have a look at CKRefreshControl, which you may be able to customize to your needs.
Right now I don't believe it is. You actually can't use it with just any UITableView. The tableView needs to be party of a UITableViewController to be used properly.
That said, its possible you might be able to get away with sticking one above your UIWebView and controlling its frame and values manually. Things that the UITableViewController has been updated to do on its own with its refreshControl property.
My answer is based on @Zaid Pathan answer but updated for Swift 4.
Finally, don't forget to stop reloading:
I've just added this very quickly to my code:
So it seems that the
UIWebView
has itself aUIScrollView
you can just attach to. Hope it's useful for you.