나는 기상 조건을 얻기 위해 API를 사용하고 있는데 내가 습도의 값이, 난 그냥스위프트, 사전 구문 분석 오류
let humidityValue = dict["main"]["humidity"]
그것을 사용하려는 경우 검색 DICT는
dict = {
base = stations;
clouds = {
all = 92;
};
cod = 200;
coord = {
lat = "31.23";
lon = "121.47";
};
dt = 1476853699;
id = 1796231;
main = {
"grnd_level" = "1028.63";
humidity = 93;
pressure = "1028.63";
"sea_level" = "1029.5";
temp = "73.38";
"temp_max" = "73.38";
"temp_min" = "73.38";
};
name = "Shanghai Shi";
rain = {
3h = "0.665";
};
sys = {
country = CN;
message = "0.0125";
sunrise = 1476827992;
sunset = 1476868662;
};
weather = (
{
description = "light rain";
icon = 10d;
id = 500;
main = Rain;
}
);
wind = {
deg = "84.50239999999999";
speed = "5.97";
};
}
입니다 공장.
그러나 문제는 I가도 나는 그것이 전무를 검색
let dscptValue = dict["weather"]["description"]
을 사용하는 경우 날씨
에 설명의 가치를 얻을 싶어요.
어때? 날씨가 일 때 두 개의 대괄호가 있음을 알 수 있습니다. 대괄호가없는 명령문과 같은지 확실하지 않습니다.
weather = (
{
description = "light rain";
icon = 10d;
id = 500;
main = Rain;
}
);
어떻게
설명의 값을 얻으려면?