Relative Content

Tag Archive for jsonswift

How Can I Eliminate The Time From The Date

First of all I’m using an API where the date returns to me as a String and it returns to me in format of yyyy-MM-dd so what I want to get is 4 September 2024 and I managed to do it but I can’t eliminate the time out of the date.

I get The given data was not valid JSON when I enter an empty data to the login form

I get The given data was not valid JSON when I enter an empty data to the login form , but expected to return “The password or mobile field is required.”, as in backend , but I get :
dataCorrupted(Swift.DecodingError.Context(codingPath: [], debugDescription: “The given data was not valid JSON.”, underlyingError: Optional(Error Domain=NSCocoaErrorDomain Code=3840 “Unexpected character ‘<‘ around line 1, column 1.” UserInfo={NSDebugDescription=Unexpected character ‘<‘ around line 1, column 1., NSJSONSerializationErrorIndex=0})))

How do i decode the full JSON of the weather API?

I’ve been following a tutorial on youtube about creating a weather app, i’ve done it and now i’m trying to improve it but i’m facing an issue :
I noticed that when i call the weather which gives the decoded output of the JSON data we got, from this decoder :

How to properly stream to a JSON

I have an app that stores photos locally, and I’m trying to create a way for users to send their photo library to another device.