-3

One of apps was worked perfectly under iOS 10, but after update to iOS 11, getting strange results, while counting date range over 10 seconds and more: enumerateDates(startingAfter:matching:matchingPolicy:repeatedTimePolicy: direction:using)

Does anyone faced with that?

Igor Kislyuk
  • 330
  • 1
  • 4
  • 14
  • 4
    What's the output? Show us the code, the expected result and the wrong result in iOS11. – Shebuka Sep 20 '17 at 09:14
  • @Shebuka I need enumerate all dates between two of them. This function simply used to store them in array for next processing. But under iOS 11 counting takes to long time. – Igor Kislyuk Sep 20 '17 at 09:56
  • 3
    @IgorKislyuk How do you expect anyone to tell you *why* it doesn't work as it supposed, when you refuse to provide any details when asked? – mag_zbc Sep 20 '17 at 11:00
  • @mag_zbc the problem was in policy. Suppose they changed logic. I fixed my problem, but there is no time to figure it out. Let's close this – Igor Kislyuk Sep 20 '17 at 11:21
  • 1
    Then, for future reference, please post an answer with details on how did you fix your problem. – mag_zbc Sep 20 '17 at 11:23

1 Answers1

0

The reason of this error was in matching policy in Foundation call for iterating from start date to fill up the range. We are using .previousTimePreservingSmallerComponents and it is work perfectly on iOS 10. Otherwise, for preventing the bug in iOS 11 please fallback to .strict policy. Hope this can help someone.

Igor Kislyuk
  • 330
  • 1
  • 4
  • 14