|
What websites do my fellow swift developers use to create JSON files to use in their projects? Any reputable and commonly used sites? |
|
I don't really think there are going to be websites that will do it for you any faster than just using the text editing program of your choice. Maybe if you already have all the data you want written out in some other type of format like an excel sheet or something it could be converted to JSON automatically. Or, if you already have the objects created in an array in your code, you could always write a function that prints all the objects out in JSON format for you. But, one way or another, you're going to have to type out the data that you want at some point, unless it is already in some kind file that somebody else has already typed out for you. Even If there is a website that creates the JSON formatting for you, you are still going to have to fill out the data for each object on that website as well, so I don't think it would really save you any time. However, once you know how to type out the format for one of the objects that you need, you should just be able to copy and paste it as needed to add more objects, and fill in the values with different data on each one. |
|
Below is the JSON file which is meant to be an erray
However I get an error saying my JSON is a dictionary when i try to pass it in the JSON decoder as shown below:
This is the error: 2022-12-17 13:05:01.388603-0500 Milestone Project 13-15[5197:152197] [Assert] UINavigationBar decoded as unlocked for UINavigationController, or navigationBar delegate set up incorrectly. Inconsistent configuration may cause problems. navigationController=<UINavigationController: 0x125017c00>, navigationBar=<UINavigationBar: 0x1247064d0; frame = (0 47; 0 50); opaque = NO; autoresize = W; layer = <CALayer: 0x600003aa6d60>> delegate=0x125017c00 typeMismatch(Swift.Array<Any>, Swift.DecodingError.Context(codingPath: [], debugDescription: "Expected to decode Array<Any> but found a dictionary instead.", underlyingError: nil)) |
|
Try using this instead.
|
|
you can refer this thread - https://www.hackingwithswift.com/forums/100-days-of-swiftui/json/13618 |
|
Also, make sure that the data types of the properties in |
SPONSORED Get accurate app localizations in minutes using AI. Choose your languages & receive translations for 40+ markets!
Sponsor Hacking with Swift and reach the world's largest Swift community!
This topic has been closed due to inactivity, so you can't reply. Please create a new topic if you need to.
All interactions here are governed by our code of conduct.
Link copied to your pasteboard.