title: How to convert toIso8601String to Swift Date
body: <p>I am trying to build a bridge between flutter and swift in iOS for a little widget. The problem I am facing is converting the DateTime.now().toIso8601String into a usable Date Object in Swift, this is how my code looks like:</p>
  <pre><code>        let shared = sharedDefaults?.object(forKey: &quot;widgetData&quot;) as? [String: String] ?? [String: String]()
          
              let isoDateFormatter = ISO8601DateFormatter()
              isoDateFormatter.timeZone = TimeZone(abbreviation: &quot;GMT&quot;)
              isoDateFormatter.formatOptions = [.withInternetDateTime,
                                                .withDashSeparatorInDate,
                                                .withFullDate,
                                                .withFractionalSeconds,
                                                .withColonSeparatorInTime]
              let realDate = isoDateFormatter.date(from: shared[&quot;start&quot;]!)
              print(realDate)
              print(shared[&quot;start&quot;]!)
            flutterData = FlutterData(title: shared[&quot;title&quot;]!,
                                          comment: shared[&quot;comment&quot;]!,
                                          end: nil,
                                          start: realDate ?? Date())
  </code></pre>
  <p>I have built in a fallback to the current Date() but I don't seem to manage to convert the DateTime String to a swift Date Object</p>
  <p>here is how it looks like when printed:</p>
  <blockquote>
  <p>2021-09-18T14:56:50.606258</p>
  </blockquote>