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.
Swift JSON decoding error: Key not found for “id” in custom type AnimalGroup
I’m encountering a fatal error when trying to decode a JSON file into my custom Swift struct AnimalGroup. The error occurs when decoding the file classification.json, and it specifically complains about a missing “id” key even though the “id” key is present in the JSON.
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 to encode/decode a SortDescriptor whose compared value is a custom type?
Let’s create a basic custom Item
type with a title and a date.
json string is not converting to model
I have json response as below.
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.
Fatal error: Failed to decode .json data from app bundle
import Foundation