mattdonnelly / Swifter

[DEPRECATED] :bird: A Twitter framework for iOS & OS X written in Swift
MIT License
2.37k stars 387 forks source link

Data instead of JSON - anyone wanna work on this with me? #345

Open lk251 opened 3 years ago

lk251 commented 3 years ago

Is this because Decodable wasn't available before? I'd like swifter to produce a Data instance which I can use JSONDecoder with. Anyone wanna collaborate on this?

not sure how to decode this JSON so I'm having to stringify with json.description first which seems like a terrible idea

lk251 commented 3 years ago

as a result, \t is appearing as tab control character, breaking JSONDecoder decoding

lk251 commented 3 years ago

@meteochu @mattdonnelly hi guys! i'm super grateful for your work, if you have a minute, I would appreciate some guidance: Why is decoding done with a bespoke JSON type, when using JSONDecoder with Swift Data type is so easy and convenient? Am I missing something? Perhaps the reason I don't see the advantage is because I didn't build the library. But right now it seems awkward to decode the by applying a set of string keys.

steipete commented 3 years ago

I need this as well and replaced the json with data in my fork.

antranapp commented 3 years ago

@steipete any chance you can share your fork?

steipete commented 3 years ago

This is like a 10 minute edit. My fork contains far more changes done specifically for my purpose, makes no sense to open source.

thebrandontyler commented 3 years ago

I submitted a PR for this back in January. Feel free to take a look at it and see if it works for you: #341