As I understand it, you need to somehow get rid of checking for nil . But I don’t understand how to do this in a specific case, and how you can change the code to avoid this error.
func loadArticles() { let feedURL = URL(string: self.feedURL)! if let parser = FeedParser(URL: feedURL) { // or FeedParser(data: data) // Parse asynchronously, not to block the UI. parser.parseAsync(queue: DispatchQueue.global(qos: .userInitiated)) { (result) in // Do your thing, then back to the Main thread DispatchQueue.main.async { // ..and update the UI switch result { case let .atom(feed): break // Atom Syndication Format Feed Model case let .rss(feed): // Really Simple Syndication Feed Model print("rss obtained!") self.articlesArray = feed.items! self.tableView.reloadData() case let .json(feed): // JSON Feed Model print("json obtained!") case let .failure(error): print(error) } } } } else { print("error parsing feed URL") } }