From 93b702f170e3fd5815d1c5f579d4e51bb286a08f Mon Sep 17 00:00:00 2001 From: Maurice Parker Date: Mon, 2 Sep 2019 15:54:49 -0500 Subject: [PATCH] Automatically copy any url in the pasteboard to the feed field for feed adds --- iOS/Add/UIKit/AddFeedViewController.swift | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/iOS/Add/UIKit/AddFeedViewController.swift b/iOS/Add/UIKit/AddFeedViewController.swift index 73210a40a..2d6295c62 100644 --- a/iOS/Add/UIKit/AddFeedViewController.swift +++ b/iOS/Add/UIKit/AddFeedViewController.swift @@ -34,6 +34,12 @@ class AddFeedViewController: UITableViewController, AddContainerViewControllerCh super.viewDidLoad() + if initialFeed == nil, let urlString = UIPasteboard.general.string as NSString? { + if urlString.rs_stringMayBeURL() { + initialFeed = urlString.rs_normalizedURL() + } + } + urlTextField.autocorrectionType = .no urlTextField.autocapitalizationType = .none urlTextField.text = initialFeed