Я получаю отчеты Crashlytics cra sh при использовании ISO8601DateFormatter с formatOptions .withFractionalSeconds
для разбора строк, подобных этому
2017-01-23T10: 12: 31Z
или
2017-01-23T10: 12: 31,484Z
или
2017-01-23T10: 12: 31,484221Z
на сегодняшний день с этим кодом:
if #available(iOS 11.0, *) {
let formatter = ISO8601DateFormatter()
formatter.formatOptions.insert(.withFractionalSeconds)
result = formatter.date(from: string)
}
полученное сообщение cra sh:
Неустранимое исключение: NSInternalInconsistencyException
Недопустимый параметр не удовлетворяет : formatOptions == 0 || ! (FormatOptions & ~ (NSISO8601DateFormatWithYear | NSISO8601DateFormatWithMonth | NSISO8601DateFormatWithWeekOfYear | NSISO8601DateFormatWithDay | NSISO8601DateFormatWithTime | NSISO8601DateFormatWithTimeZone | NSISO8601DateFormatWithSpaceBetweenDateAndTime | NSISO8601DateFormatWithDashSeparatorInDate | NSISO8601DateFormatWithColonSeparatorInTime | NSISO8601DateFormatWithColonSeparatorInTimeZone | NSISO8601DateFormatWithFullDate | NSISO8601DateFormatWithFullTime | NSISO8601DateFormatWithInternetDateTime))