-
Notifications
You must be signed in to change notification settings - Fork 111
Closed
Labels
Milestone
Description
Not all APIs are available on all versions of iOS. There are annotations in Objective C for this, so we can turn that into version checks, and throw user friendly exceptions rather than crashing. Suggestion from Brian:
- (NSURLSessionWebSocketTask *)webSocketTaskWithURL:(NSURL *)url protocols:(NSArray<NSString *>*)protocols API_AVAILABLE(macos(10.15), ios(13.0), watchos(6.0), tvos(13.0));
Could translate into:
webSocketTaskWithURL(NSURL url, NSArray<NSString> protocols) {
if (platform.isIOS) {
if (platform.version < 13.0) {
throw UnsupportedError("webSocketTaskWithURL requires: macos > 10.15, ios >= 13.0, watchos >= 6.0 or tvos >= 13.0 [is ios ${platform.version}.")
}
} else ...
<do the real work>
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Done