Getting an error decoding JSON, Swift 4.2Safely turning a JSON string into an objectHow do I format a Microsoft JSON date?Can comments be used in JSON?How can I pretty-print JSON in a shell script?What is the correct JSON content type?Why does Google prepend while(1); to their JSON responses?Why can't Python parse this JSON data?How can I pretty-print JSON using JavaScript?Parse JSON in JavaScript?How do I POST JSON data with Curl from a terminal/commandline to Test Spring REST?
Which audio encoders in FFmpeg support 8 kHz?
prevent add-on being enabled in lower Blender version than 2.8
How are hillsides farmed?
Copying files: Does Windows write to disk if files are identical
Bass - describe attacking one note in one or more bars
Is there an unambiguous name for the social/political theory "liberalism" without "leftist"?
How do we kill what we can't see?
Samples of old guidance software
SpaceX Starship landing on Moon or Mars: why doesn't it fall over?
How to delete music as it's being played
Why can java not infer a supertype
Is encrypted e-mail sent over TLS 1.3 a form of "forward secrecy" (similar to something like Signal)?
“Ankaŭ” ĉe la fino de frazo
Showing a homeless person that you care about their well-being
Windows-to-Linux-migration
Heat-shrink tubing available as a roll like adhesive tape?
Why is Microwaved mac & cheese burnt where they touch?
How do social media apps notify you when someone else takes a screenshot of your profile?
What adaptations would be advantageous given a regular, but extreme variation in climate?
Are countries other than the US concerned about preferred pronouns and how they relate to gender?
Is this really played by 2200+ players?
相手には when speaking of "two third persons"
Why would shrinking TEMPDB log lead to slowness?
How to distinguish between different instruments in a classical orchestra?
Getting an error decoding JSON, Swift 4.2
Safely turning a JSON string into an objectHow do I format a Microsoft JSON date?Can comments be used in JSON?How can I pretty-print JSON in a shell script?What is the correct JSON content type?Why does Google prepend while(1); to their JSON responses?Why can't Python parse this JSON data?How can I pretty-print JSON using JavaScript?Parse JSON in JavaScript?How do I POST JSON data with Curl from a terminal/commandline to Test Spring REST?
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty
margin-bottom:0;
I am getting an error when decoding JSON in swift 4.2
Expected to decode Array but found a dictionary instead.
My JSON Model:
public struct NewsSource: Equatable, Decodable
public let id: String?
public let name: String?
public let sourceDescription: String?
public let url: URL?
enum CodingKeys: String, CodingKey
case id
case name
case sourceDescription = "description"
case url
public init(id: String,
name: String,
sourceDescription: String,
url: URL,
category: NewsCategory,
language: NewsLanguage,
country: NewsCountry)
self.id = id
self.name = name
self.sourceDescription = sourceDescription
self.url = url
How I fetch the JSON:
func fetchJSON()
let urlString = "https://newsapi.org/v2/sources?apiKey=myAPIKey"
guard let url = URL(string: urlString) else return
URLSession.shared.dataTask(with: url) (data, _, err) in
DispatchQueue.main.async
if let err = err
print("Failed to get data from url:", err)
return
guard let data = data else return
print(data)
do
let decoder = JSONDecoder()
decoder.keyDecodingStrategy = .convertFromSnakeCase
self.Sources = try decoder.decode([NewsSource].self, from: data)
self.tableView.reloadData()
catch let jsonErr
print("Failed to decode:", jsonErr)
.resume()
ios json swift swift4.2 jsondecoder
add a comment
|
I am getting an error when decoding JSON in swift 4.2
Expected to decode Array but found a dictionary instead.
My JSON Model:
public struct NewsSource: Equatable, Decodable
public let id: String?
public let name: String?
public let sourceDescription: String?
public let url: URL?
enum CodingKeys: String, CodingKey
case id
case name
case sourceDescription = "description"
case url
public init(id: String,
name: String,
sourceDescription: String,
url: URL,
category: NewsCategory,
language: NewsLanguage,
country: NewsCountry)
self.id = id
self.name = name
self.sourceDescription = sourceDescription
self.url = url
How I fetch the JSON:
func fetchJSON()
let urlString = "https://newsapi.org/v2/sources?apiKey=myAPIKey"
guard let url = URL(string: urlString) else return
URLSession.shared.dataTask(with: url) (data, _, err) in
DispatchQueue.main.async
if let err = err
print("Failed to get data from url:", err)
return
guard let data = data else return
print(data)
do
let decoder = JSONDecoder()
decoder.keyDecodingStrategy = .convertFromSnakeCase
self.Sources = try decoder.decode([NewsSource].self, from: data)
self.tableView.reloadData()
catch let jsonErr
print("Failed to decode:", jsonErr)
.resume()
ios json swift swift4.2 jsondecoder
add a comment
|
I am getting an error when decoding JSON in swift 4.2
Expected to decode Array but found a dictionary instead.
My JSON Model:
public struct NewsSource: Equatable, Decodable
public let id: String?
public let name: String?
public let sourceDescription: String?
public let url: URL?
enum CodingKeys: String, CodingKey
case id
case name
case sourceDescription = "description"
case url
public init(id: String,
name: String,
sourceDescription: String,
url: URL,
category: NewsCategory,
language: NewsLanguage,
country: NewsCountry)
self.id = id
self.name = name
self.sourceDescription = sourceDescription
self.url = url
How I fetch the JSON:
func fetchJSON()
let urlString = "https://newsapi.org/v2/sources?apiKey=myAPIKey"
guard let url = URL(string: urlString) else return
URLSession.shared.dataTask(with: url) (data, _, err) in
DispatchQueue.main.async
if let err = err
print("Failed to get data from url:", err)
return
guard let data = data else return
print(data)
do
let decoder = JSONDecoder()
decoder.keyDecodingStrategy = .convertFromSnakeCase
self.Sources = try decoder.decode([NewsSource].self, from: data)
self.tableView.reloadData()
catch let jsonErr
print("Failed to decode:", jsonErr)
.resume()
ios json swift swift4.2 jsondecoder
I am getting an error when decoding JSON in swift 4.2
Expected to decode Array but found a dictionary instead.
My JSON Model:
public struct NewsSource: Equatable, Decodable
public let id: String?
public let name: String?
public let sourceDescription: String?
public let url: URL?
enum CodingKeys: String, CodingKey
case id
case name
case sourceDescription = "description"
case url
public init(id: String,
name: String,
sourceDescription: String,
url: URL,
category: NewsCategory,
language: NewsLanguage,
country: NewsCountry)
self.id = id
self.name = name
self.sourceDescription = sourceDescription
self.url = url
How I fetch the JSON:
func fetchJSON()
let urlString = "https://newsapi.org/v2/sources?apiKey=myAPIKey"
guard let url = URL(string: urlString) else return
URLSession.shared.dataTask(with: url) (data, _, err) in
DispatchQueue.main.async
if let err = err
print("Failed to get data from url:", err)
return
guard let data = data else return
print(data)
do
let decoder = JSONDecoder()
decoder.keyDecodingStrategy = .convertFromSnakeCase
self.Sources = try decoder.decode([NewsSource].self, from: data)
self.tableView.reloadData()
catch let jsonErr
print("Failed to decode:", jsonErr)
.resume()
ios json swift swift4.2 jsondecoder
ios json swift swift4.2 jsondecoder
edited Mar 29 at 1:55
Simply Ged
3,6608 gold badges21 silver badges29 bronze badges
3,6608 gold badges21 silver badges29 bronze badges
asked Mar 28 at 21:40
Mäsäm MähmôôdMäsäm Mähmôôd
12 bronze badges
12 bronze badges
add a comment
|
add a comment
|
2 Answers
2
active
oldest
votes
If you look at the JSON that is being returned it looks like this:
{
"status": "ok",
"sources": [
"id": "abc-news",
"name": "ABC News",
"description": "Your trusted source for breaking news, analysis, exclusive interviews, headlines, and videos at ABCNews.com.",
"url": "https://abcnews.go.com",
"category": "general",
"language": "en",
"country": "us"
,
"id": "abc-news-au",
"name": "ABC News (AU)",
"description": "Australia's most trusted source of local, national and world news. Comprehensive, independent, in-depth analysis, the latest business, sport, weather and more.",
"url": "http://www.abc.net.au/news",
"category": "general",
"language": "en",
"country": "au"
,
...
While there is an array of sources, the array is not the root. The root of the JSON is an object with a status
string and and a sources
array. This is why the decoder is failing.
You need to define an additional struct to handle this:
struct NewsResult
let status: String
let sources: [NewsSource]
Then you decode this object:
let sourceResult = try decoder.decode(NewsResult.self, from: data)
self.sources = sourceResult.sources
Thank you friend. made changes and now it's working.
– Mäsäm Mähmôôd
Mar 28 at 22:08
add a comment
|
This should be your structure:
struct NewsSource: Codable
let status: String
let sources: [NewsSource]
public struct NewsSource: Equatable, Decodable
public let id: String?
public let name: String?
public let sourceDescription: String?
public let url: URL?
enum CodingKeys: String, CodingKey
case id
case name
case sourceDescription = "description"
case url
public init(id: String,
name: String,
sourceDescription: String,
url: URL,
category: NewsCategory,
language: NewsLanguage,
country: NewsCountry)
self.id = id
self.name = name
self.sourceDescription = sourceDescription
self.url = url
struct Source: Codable
let id, name, description: String
let url: String
let category: Category
let language, country: String
enum Category: String, Codable
case business = "business"
case entertainment = "entertainment"
case general = "general"
case health = "health"
case science = "science"
case sports = "sports"
case technology = "technology"
And then to decode it:
let decoder = JSONDecoder()
decoder.keyDecodingStrategy = .convertFromSnakeCase
let newsSource = try? decoder.decode(NewsSource.self, from: data)
self.Sources = newsSource.sources
self.tableView.reloadData()
Hope this helps!
I have done the changes and its working now Thanks.
– Mäsäm Mähmôôd
Mar 28 at 22:07
Please mark the questions as correct.
– OkiRules
Mar 28 at 23:31
Also have a look at my edit on the question, I have hidden your API key so others can't use it and changed some spelling and grammar.
– OkiRules
Mar 28 at 23:37
thank you for the changes you have made.
– Mäsäm Mähmôôd
Mar 31 at 18:02
add a comment
|
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/4.0/"u003ecc by-sa 4.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55407256%2fgetting-an-error-decoding-json-swift-4-2%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
If you look at the JSON that is being returned it looks like this:
{
"status": "ok",
"sources": [
"id": "abc-news",
"name": "ABC News",
"description": "Your trusted source for breaking news, analysis, exclusive interviews, headlines, and videos at ABCNews.com.",
"url": "https://abcnews.go.com",
"category": "general",
"language": "en",
"country": "us"
,
"id": "abc-news-au",
"name": "ABC News (AU)",
"description": "Australia's most trusted source of local, national and world news. Comprehensive, independent, in-depth analysis, the latest business, sport, weather and more.",
"url": "http://www.abc.net.au/news",
"category": "general",
"language": "en",
"country": "au"
,
...
While there is an array of sources, the array is not the root. The root of the JSON is an object with a status
string and and a sources
array. This is why the decoder is failing.
You need to define an additional struct to handle this:
struct NewsResult
let status: String
let sources: [NewsSource]
Then you decode this object:
let sourceResult = try decoder.decode(NewsResult.self, from: data)
self.sources = sourceResult.sources
Thank you friend. made changes and now it's working.
– Mäsäm Mähmôôd
Mar 28 at 22:08
add a comment
|
If you look at the JSON that is being returned it looks like this:
{
"status": "ok",
"sources": [
"id": "abc-news",
"name": "ABC News",
"description": "Your trusted source for breaking news, analysis, exclusive interviews, headlines, and videos at ABCNews.com.",
"url": "https://abcnews.go.com",
"category": "general",
"language": "en",
"country": "us"
,
"id": "abc-news-au",
"name": "ABC News (AU)",
"description": "Australia's most trusted source of local, national and world news. Comprehensive, independent, in-depth analysis, the latest business, sport, weather and more.",
"url": "http://www.abc.net.au/news",
"category": "general",
"language": "en",
"country": "au"
,
...
While there is an array of sources, the array is not the root. The root of the JSON is an object with a status
string and and a sources
array. This is why the decoder is failing.
You need to define an additional struct to handle this:
struct NewsResult
let status: String
let sources: [NewsSource]
Then you decode this object:
let sourceResult = try decoder.decode(NewsResult.self, from: data)
self.sources = sourceResult.sources
Thank you friend. made changes and now it's working.
– Mäsäm Mähmôôd
Mar 28 at 22:08
add a comment
|
If you look at the JSON that is being returned it looks like this:
{
"status": "ok",
"sources": [
"id": "abc-news",
"name": "ABC News",
"description": "Your trusted source for breaking news, analysis, exclusive interviews, headlines, and videos at ABCNews.com.",
"url": "https://abcnews.go.com",
"category": "general",
"language": "en",
"country": "us"
,
"id": "abc-news-au",
"name": "ABC News (AU)",
"description": "Australia's most trusted source of local, national and world news. Comprehensive, independent, in-depth analysis, the latest business, sport, weather and more.",
"url": "http://www.abc.net.au/news",
"category": "general",
"language": "en",
"country": "au"
,
...
While there is an array of sources, the array is not the root. The root of the JSON is an object with a status
string and and a sources
array. This is why the decoder is failing.
You need to define an additional struct to handle this:
struct NewsResult
let status: String
let sources: [NewsSource]
Then you decode this object:
let sourceResult = try decoder.decode(NewsResult.self, from: data)
self.sources = sourceResult.sources
If you look at the JSON that is being returned it looks like this:
{
"status": "ok",
"sources": [
"id": "abc-news",
"name": "ABC News",
"description": "Your trusted source for breaking news, analysis, exclusive interviews, headlines, and videos at ABCNews.com.",
"url": "https://abcnews.go.com",
"category": "general",
"language": "en",
"country": "us"
,
"id": "abc-news-au",
"name": "ABC News (AU)",
"description": "Australia's most trusted source of local, national and world news. Comprehensive, independent, in-depth analysis, the latest business, sport, weather and more.",
"url": "http://www.abc.net.au/news",
"category": "general",
"language": "en",
"country": "au"
,
...
While there is an array of sources, the array is not the root. The root of the JSON is an object with a status
string and and a sources
array. This is why the decoder is failing.
You need to define an additional struct to handle this:
struct NewsResult
let status: String
let sources: [NewsSource]
Then you decode this object:
let sourceResult = try decoder.decode(NewsResult.self, from: data)
self.sources = sourceResult.sources
answered Mar 28 at 21:49
Paulw11Paulw11
75.3k10 gold badges100 silver badges117 bronze badges
75.3k10 gold badges100 silver badges117 bronze badges
Thank you friend. made changes and now it's working.
– Mäsäm Mähmôôd
Mar 28 at 22:08
add a comment
|
Thank you friend. made changes and now it's working.
– Mäsäm Mähmôôd
Mar 28 at 22:08
Thank you friend. made changes and now it's working.
– Mäsäm Mähmôôd
Mar 28 at 22:08
Thank you friend. made changes and now it's working.
– Mäsäm Mähmôôd
Mar 28 at 22:08
add a comment
|
This should be your structure:
struct NewsSource: Codable
let status: String
let sources: [NewsSource]
public struct NewsSource: Equatable, Decodable
public let id: String?
public let name: String?
public let sourceDescription: String?
public let url: URL?
enum CodingKeys: String, CodingKey
case id
case name
case sourceDescription = "description"
case url
public init(id: String,
name: String,
sourceDescription: String,
url: URL,
category: NewsCategory,
language: NewsLanguage,
country: NewsCountry)
self.id = id
self.name = name
self.sourceDescription = sourceDescription
self.url = url
struct Source: Codable
let id, name, description: String
let url: String
let category: Category
let language, country: String
enum Category: String, Codable
case business = "business"
case entertainment = "entertainment"
case general = "general"
case health = "health"
case science = "science"
case sports = "sports"
case technology = "technology"
And then to decode it:
let decoder = JSONDecoder()
decoder.keyDecodingStrategy = .convertFromSnakeCase
let newsSource = try? decoder.decode(NewsSource.self, from: data)
self.Sources = newsSource.sources
self.tableView.reloadData()
Hope this helps!
I have done the changes and its working now Thanks.
– Mäsäm Mähmôôd
Mar 28 at 22:07
Please mark the questions as correct.
– OkiRules
Mar 28 at 23:31
Also have a look at my edit on the question, I have hidden your API key so others can't use it and changed some spelling and grammar.
– OkiRules
Mar 28 at 23:37
thank you for the changes you have made.
– Mäsäm Mähmôôd
Mar 31 at 18:02
add a comment
|
This should be your structure:
struct NewsSource: Codable
let status: String
let sources: [NewsSource]
public struct NewsSource: Equatable, Decodable
public let id: String?
public let name: String?
public let sourceDescription: String?
public let url: URL?
enum CodingKeys: String, CodingKey
case id
case name
case sourceDescription = "description"
case url
public init(id: String,
name: String,
sourceDescription: String,
url: URL,
category: NewsCategory,
language: NewsLanguage,
country: NewsCountry)
self.id = id
self.name = name
self.sourceDescription = sourceDescription
self.url = url
struct Source: Codable
let id, name, description: String
let url: String
let category: Category
let language, country: String
enum Category: String, Codable
case business = "business"
case entertainment = "entertainment"
case general = "general"
case health = "health"
case science = "science"
case sports = "sports"
case technology = "technology"
And then to decode it:
let decoder = JSONDecoder()
decoder.keyDecodingStrategy = .convertFromSnakeCase
let newsSource = try? decoder.decode(NewsSource.self, from: data)
self.Sources = newsSource.sources
self.tableView.reloadData()
Hope this helps!
I have done the changes and its working now Thanks.
– Mäsäm Mähmôôd
Mar 28 at 22:07
Please mark the questions as correct.
– OkiRules
Mar 28 at 23:31
Also have a look at my edit on the question, I have hidden your API key so others can't use it and changed some spelling and grammar.
– OkiRules
Mar 28 at 23:37
thank you for the changes you have made.
– Mäsäm Mähmôôd
Mar 31 at 18:02
add a comment
|
This should be your structure:
struct NewsSource: Codable
let status: String
let sources: [NewsSource]
public struct NewsSource: Equatable, Decodable
public let id: String?
public let name: String?
public let sourceDescription: String?
public let url: URL?
enum CodingKeys: String, CodingKey
case id
case name
case sourceDescription = "description"
case url
public init(id: String,
name: String,
sourceDescription: String,
url: URL,
category: NewsCategory,
language: NewsLanguage,
country: NewsCountry)
self.id = id
self.name = name
self.sourceDescription = sourceDescription
self.url = url
struct Source: Codable
let id, name, description: String
let url: String
let category: Category
let language, country: String
enum Category: String, Codable
case business = "business"
case entertainment = "entertainment"
case general = "general"
case health = "health"
case science = "science"
case sports = "sports"
case technology = "technology"
And then to decode it:
let decoder = JSONDecoder()
decoder.keyDecodingStrategy = .convertFromSnakeCase
let newsSource = try? decoder.decode(NewsSource.self, from: data)
self.Sources = newsSource.sources
self.tableView.reloadData()
Hope this helps!
This should be your structure:
struct NewsSource: Codable
let status: String
let sources: [NewsSource]
public struct NewsSource: Equatable, Decodable
public let id: String?
public let name: String?
public let sourceDescription: String?
public let url: URL?
enum CodingKeys: String, CodingKey
case id
case name
case sourceDescription = "description"
case url
public init(id: String,
name: String,
sourceDescription: String,
url: URL,
category: NewsCategory,
language: NewsLanguage,
country: NewsCountry)
self.id = id
self.name = name
self.sourceDescription = sourceDescription
self.url = url
struct Source: Codable
let id, name, description: String
let url: String
let category: Category
let language, country: String
enum Category: String, Codable
case business = "business"
case entertainment = "entertainment"
case general = "general"
case health = "health"
case science = "science"
case sports = "sports"
case technology = "technology"
And then to decode it:
let decoder = JSONDecoder()
decoder.keyDecodingStrategy = .convertFromSnakeCase
let newsSource = try? decoder.decode(NewsSource.self, from: data)
self.Sources = newsSource.sources
self.tableView.reloadData()
Hope this helps!
answered Mar 28 at 21:56
OkiRulesOkiRules
2462 silver badges13 bronze badges
2462 silver badges13 bronze badges
I have done the changes and its working now Thanks.
– Mäsäm Mähmôôd
Mar 28 at 22:07
Please mark the questions as correct.
– OkiRules
Mar 28 at 23:31
Also have a look at my edit on the question, I have hidden your API key so others can't use it and changed some spelling and grammar.
– OkiRules
Mar 28 at 23:37
thank you for the changes you have made.
– Mäsäm Mähmôôd
Mar 31 at 18:02
add a comment
|
I have done the changes and its working now Thanks.
– Mäsäm Mähmôôd
Mar 28 at 22:07
Please mark the questions as correct.
– OkiRules
Mar 28 at 23:31
Also have a look at my edit on the question, I have hidden your API key so others can't use it and changed some spelling and grammar.
– OkiRules
Mar 28 at 23:37
thank you for the changes you have made.
– Mäsäm Mähmôôd
Mar 31 at 18:02
I have done the changes and its working now Thanks.
– Mäsäm Mähmôôd
Mar 28 at 22:07
I have done the changes and its working now Thanks.
– Mäsäm Mähmôôd
Mar 28 at 22:07
Please mark the questions as correct.
– OkiRules
Mar 28 at 23:31
Please mark the questions as correct.
– OkiRules
Mar 28 at 23:31
Also have a look at my edit on the question, I have hidden your API key so others can't use it and changed some spelling and grammar.
– OkiRules
Mar 28 at 23:37
Also have a look at my edit on the question, I have hidden your API key so others can't use it and changed some spelling and grammar.
– OkiRules
Mar 28 at 23:37
thank you for the changes you have made.
– Mäsäm Mähmôôd
Mar 31 at 18:02
thank you for the changes you have made.
– Mäsäm Mähmôôd
Mar 31 at 18:02
add a comment
|
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55407256%2fgetting-an-error-decoding-json-swift-4-2%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown