How do I create a custom struct to assign the contents of array into usable variables?
问题 I have a JSON function that previously mapped the contents of an array ( countries , divisions , teams (not shown)) into seperate variables using this code: let task = URLSession.shared.dataTask{ (response: URLResponse?, error: Error?) in DispatchQueue.main.async { if error != nil { print("error=\(error)") return } do{ let json = try JSONSerialization.jsonObject(with: data!, options: .allowFragments) as? [String:AnyObject] print (json) if let arr = json?["countries"] as? [[String:String]] {