title: SwiftUI Date formatting
body: <p>i take this from Github:
  <a href="https://github.com/emilioschepis/techfeed" rel="nofollow noreferrer">https://github.com/emilioschepis/techfeed</a>
  When i start the app, i getting a issue in the console:
  Could not convert &quot;Wed, 03 Aug 2011 09:44:00 +0200&quot; to Date.
  and i have a black screen.</p>
  <p>I ´m on the latest xCode version and update the Code.
  thanks for Answers....
  <img src="https://i.stack.imgur.com/SfdZQ.jpg" alt="SCREENSHOT" /></p>
  <p>Parser:</p>
  <pre><code>import Foundation
  
  class ReleasesParser: NSObject {
  typealias CompletionResult = ([Release]) -&gt; Void
  
  private static var formatter: DateFormatter = {
      let formatter = DateFormatter()
      formatter.dateFormat = &quot;E, dd MMM yyyy HH:mm:ss z&quot;
      return formatter
  }()
  
  private var releases = [Release]()
  private var currentElement = &quot;&quot;
  private var currentGuid = &quot;&quot;
  private var currentTitle = &quot;&quot;
  private var currentDescription = &quot;&quot;
  private var currentPubDate = &quot;&quot;
  private var completion: CompletionResult?
  
  func parse(data: Data, completion: @escaping CompletionResult) {
      self.completion = completion
      
      if data.isEmpty {
          completion([])
          return
      }
      
      let parser = XMLParser(data: data)
      parser.delegate = self
      parser.parse()
  }
  }
  
  extension ReleasesParser: XMLParserDelegate {
  func parserDidStartDocument(_ parser: XMLParser) {
      releases.removeAll(keepingCapacity: true)
  }
  
  func parser(_ parser: XMLParser, didStartElement elementName: String, namespaceURI: String?, qualifiedName qName: String?, attributes attributeDict: [String : String] = [:]) {
      currentElement = elementName
      
      // If we are about to start a new item clear the fields
      if currentElement == &quot;item&quot; {
          currentGuid = &quot;&quot;
          currentTitle = &quot;&quot;
          currentDescription = &quot;&quot;
          currentPubDate = &quot;&quot;
      }
  }
  
  func parser(_ parser: XMLParser, foundCharacters string: String) {
      switch currentElement {
      case &quot;guid&quot;:
          currentGuid += string.trimmingCharacters(in: .whitespacesAndNewlines)
      case &quot;title&quot;:
          currentTitle += string.trimmingCharacters(in: .whitespacesAndNewlines)
      case &quot;description&quot;:
          currentDescription += string.trimmingCharacters(in: .whitespacesAndNewlines)
      case &quot;pubDate&quot;:
          currentPubDate += string.trimmingCharacters(in: .whitespacesAndNewlines)
      default:
          break
      }
  }
  
  func parser(_ parser: XMLParser, didEndElement elementName: String, namespaceURI: String?, qualifiedName qName: String?) {
      // If we are about to end an item add it to the list
      if elementName == &quot;item&quot; {
          guard let date = Self.formatter.date(from: currentPubDate) else {
              print(&quot;Could not convert \&quot;\(currentPubDate)\&quot; to Date.&quot;)
              return
          }
          
          let release = Release(id: currentGuid,
                                    title: currentTitle,
                                    description: currentDescription,
                                    date: date)
          
          releases.append(release)
      }
  }
  
  func parserDidEndDocument(_ parser: XMLParser) {
      completion?(releases)
  }}
  </code></pre>
  <p>ListViewRow:</p>
  <pre><code>import SwiftUI
  
  
  struct ReleaseRow : View {
  var release: Release
  
  private var formatter: DateFormatter = {
      let formatter = DateFormatter()
      formatter.dateFormat = &quot;E, dd MMM yyyy&quot;
      return formatter
  }()
  
  init(_ release: Release) {
      self.release = release
  }
  
  var body: some View {
      VStack(alignment: .leading) {
          Text(release.title)
              .font(.headline)
          Text(&quot;\(release.date, formatter: formatter)&quot;)
              .font(.subheadline)
              .foregroundColor(.gray)
      }
      .frame(height: 44.0)
  }}
  </code></pre>