iOS web browser with a focus on security and privacy
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

WVT: add pull-to-refresh

closes #21

+16
+1
Endless/WebViewTab.h
··· 96 96 97 97 @property (strong, atomic) UIView *viewHolder; 98 98 @property (strong, atomic) UIWebView *webView; 99 + @property (strong, atomic) UIRefreshControl *refresher; 99 100 @property (strong, atomic) NSURL *url; 100 101 @property BOOL needsRefresh; 101 102 @property (strong, atomic) NSNumber *tabIndex;
+15
Endless/WebViewTab.m
··· 73 73 [swipeLeft setDelegate:self]; 74 74 [self.webView addGestureRecognizer:swipeLeft]; 75 75 76 + self.refresher = [[UIRefreshControl alloc] init]; 77 + [self.refresher setAttributedTitle:[[NSAttributedString alloc] initWithString:@"Pull to Refresh Page"]]; 78 + [self.refresher addTarget:self action:@selector(forceRefreshFromRefresher) forControlEvents:UIControlEventValueChanged]; 79 + [self.webView.scrollView addSubview:self.refresher]; 80 + 76 81 _titleHolder = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 0, 0)]; 77 82 [_titleHolder setBackgroundColor:[UIColor colorWithRed:0 green:0 blue:0 alpha:0.75]]; 78 83 ··· 690 695 - (void)forceRefresh 691 696 { 692 697 [self loadURL:[self url] withForce:YES]; 698 + } 699 + 700 + - (void)forceRefreshFromRefresher 701 + { 702 + [self forceRefresh]; 703 + 704 + /* delay just so it confirms to the user that something happened */ 705 + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 0.5 * NSEC_PER_SEC), dispatch_get_main_queue(), ^(void) { 706 + [self.refresher endRefreshing]; 707 + }); 693 708 } 694 709 695 710 - (void)zoomOut