So, I recently updated my MacOS to Catalina and installed XCode 11.5. Before that I had High Sierra and the maximum version of XCode that High Sierra supports (don't remember the version number).
So, an app I had built on that combo worked fine in XCode, but now after the update when I open I cannot run the app, because I get a Strideable error. I have the following code in one of my controllers which worked fine before this:
extension Date : Strideable {
public func advanced(by n: Int) -> Date {
return Calendar.current.date(byAdding: .day, value: n, to: self) ?? self
}
public func distance(to other: Date) -> Int {
return Calendar.current.dateComponents([.day], from: other, to: self).day ?? 0
}
}
I basically use this for a calendar I am implementing inside the app.
So, now when I try to run the app I get these two errors:
Protocol 'Strideable' requires 'advanced(by:)' to be available in iOS 11.0.0 and newer
Protocol 'Strideable' requires 'distance(to:)' to be available in iOS 11.0.0 and newer
As you can see I have both these functions implemented.
Inside my app's Deployment Info I have iOS 11.0 as minimum requirement for the app.
Besides, the current version of the app is published on the App Store and working fine. What can be the issue here?
Ok, I am not sure why, but apparently at some point there was an update for Strideable, so the only thing I had to do was delete my Strideable
extension.
Once I did that, the app worked without any issues.