Hi
Trying to implement the JSONSerialization unimplemented method jsonObject(withStream).
JSONSerialization.jsonObject(with stream: InputStream, options opt: ReadingOptions = []) throws -> AnyObject
The comments in the source code mentions that apart from stream configuration all other behaviour of this method is the same as the JSONObjectWithData:options:error.
This implies that I can internally reuse the JSONObjectWithData method, however its return type is ‘Any’ whereas the return type in jsonObjectWithStream is ‘AnyObject’. As I cannot downcast ‘Any’ to ‘AnyObject’, I’m looking for inputs if I should rewrite the behaviour or is there any other way?
This implies that I can internally reuse the JSONObjectWithData method, however its return type is ‘Any’ whereas the return type in jsonObjectWithStream is ‘AnyObject’. As I cannot downcast ‘Any’ to ‘AnyObject’, I’m looking for inputs if I should rewrite the behaviour or is there any other way?
Thank you.
-Mamatha.
_______________________________________________ swift-corelibs-dev mailing list swift-corelibs-dev@swift.org https://lists.swift.org/mailman/listinfo/swift-corelibs-dev