Commit 0fcbd765 authored by Felix Paul Kühne's avatar Felix Paul Kühne
Browse files

download VC: re-write URL fetching from pasteboard to create a smaller number of false positives

parent b0f0c44d
......@@ -78,18 +78,10 @@
- (void)viewWillAppear:(BOOL)animated
if ([[UIPasteboard generalPasteboard] containsPasteboardTypes:@[@"public.url", @"public.text"]]) {
NSURL *pasteURL = [[UIPasteboard generalPasteboard] valueForPasteboardType:@"public.url"];
if (!pasteURL || [[pasteURL absoluteString] isEqualToString:@""]) {
NSString *pasteString = [[UIPasteboard generalPasteboard] valueForPasteboardType:@"public.text"];
pasteURL = [NSURL URLWithString:pasteString];
if (pasteURL && ![[pasteURL scheme] isEqualToString:@""] && ![[pasteURL absoluteString] isEqualToString:@""])
self.urlField.text = [pasteURL absoluteString];
UIPasteboard *pasteboard = [UIPasteboard generalPasteboard];
if ([pasteboard containsPasteboardTypes:@[@"public.url"]])
self.urlField.text = [[pasteboard valueForPasteboardType:@"public.url"] absoluteString];
[self _updateUI];
[super viewWillAppear:animated];
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment