let json = JSON(response.result.value!) let things = json.array.map { jsonThing in Thing() }!
json.arrayreturns an array of one hundred JSONs. After the call, mapI get one Thing.
json.array
JSON
map
Thing
Why don't I have a new Things array ?
SwiftyJSON has two types of getters: optional and optional.
Optional getters have the syntax of the name "... Value".
Additionally:
non-optional:
json.arrayValue
: , . , if let ( ) : , ..
if let
json.array [JSON]?, [JSON]
[JSON]?
[JSON]
, .map Optional<[JSON]>, Array<JSON>, .
.map
Optional<[JSON]>
Array<JSON>
:
json.array?.map ...
Source: https://habr.com/ru/post/1613369/More articles:DataContractJsonSerializer human readable json - jsonCan we stop or remove the animation effect in focus using UIButton and give a different tvOS border effect - tvosCannot resolve character system and other namespaces when using ASP.NET 5 in the VS2015 community - c #Is there a way to get the search result that I get in the App Store app on an iOS device? (How to get ipa file in "App Store"?) - iosAWS CodeDeploy runs before user data script automatically scales - windows-serverWebapi parameter is null for the method - jsonПочему результаты API поиска iTtunes упорядочены иначе, чем результат поиска на устройстве iOS? - iosTypeError: io.sockets.clients не является функцией - node.jshttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1613373/how-to-pass-the-variables-to-angularjs-config&usg=ALkJrhgH_EvuGJEIoLnEIRsA7YaZgSoxOwJava Java Server Transfer HTTP - javaAll Articles