I did my research and found a working example, but I could not find any documentation that explicitly explains importing JSON from URL and decoding it. Perhaps, I am searching with wrong keywords.
So, what keywords should use to find out how to import JSON from URL in Swift 4? Are there any well-documented blog post or documentations for it?
I went to the Apple's official documentation on JSON decoding and it says...
import Foundation
let data: Data // received from a network request, for example
let json = try? JSONSerialization.jsonObject(with: data, options: [])
This is not helpful at all! I realized a lot of tutorials skip this step to fetch JSON from URL or just locally create a JSON object. like this this this
Please help me find a good source for this.