I am grabbing the URL from a struct and sending it to a UITapGesture
, and I tried printing it(it prints URL), but it doesn't want to actually open the URL.
@objc func getUrl(sender: UITapGestureRecognizer){
guard let url = self.rssUrl else { return }
print(url)
UIApplication.shared.open(url, options: [:], completionHandler: nil)
}
Grabbing an URL here
var rssUrl: URL?
var item: RSSItem! {
DispatchQueue.global(qos: .userInteractive).async {
//other code
let store_Article = Article(dict: ["text": sum, "rssUrl": rssLink])
storedArticle.append(store_Article)
let data = dataUrl.init(articleUrl: store_Article).someUrl
DispatchQueue.main.sync {
//other code
}
}
}
Edit
it prints: http:/www.instyle.com/news/rihanna-30th-birthday-party -- file:///
for an example