Change to only access the Pasteboard if there is a URL on it

This commit is contained in:
Maurice Parker
2022-11-04 22:01:56 -05:00
parent e7fdac6b41
commit 5bc3288d59

View File

@@ -54,10 +54,8 @@ class AddFeedViewController: UITableViewController {
activityIndicator.isHidden = true
activityIndicator.color = .label
if initialFeed == nil, let urlString = UIPasteboard.general.string {
if urlString.mayBeURL {
initialFeed = urlString.normalizedURL
}
if initialFeed == nil && UIPasteboard.general.hasURLs, let url = UIPasteboard.general.url {
initialFeed = url.absoluteString.normalizedURL
}
urlTextField.autocorrectionType = .no