My problem is try convert string to date and crash.My app is on App Store, and running on my device, but it crashes on some devices.I looked crashes log and see it,is getting crash when string to date.I don't understand why my device is working or some devices is working well but others is crash.
func toDate() -> Date {
let dateFormatter = DateFormatter()
dateFormatter.dateFormat = "yyyy-MM-dd'T'HH:mm:ss+03:00" //Your date format
dateFormatter.timeZone = TimeZone(abbreviation: "GMT+3:00") //Current time zone
//according to date format your date string
guard let date = dateFormatter.date(from: self) else {
fatalError()
}
return date
}