Convert ISO8601 To Date In Swift

import Foundation
let isoDate = "2020-01-22T11:22:00+0000"
let dateFormatter = DateFormatter()
dateFormatter.locale = Locale(identifier: "en_US_POSIX")
dateFormatter.dateFormat = "yyyy-MM-dd'T'HH:mm:ssZ"
if let date = dateFormatter.date(from: isoDate) {
  // do something with date...
}