簡體   English   中英

即使將字段更改為匹配,如何在 SWIFT 中使用 JSON 解碼器更正類型不匹配錯誤?

[英]How can I correct a Type Mismatch error using JSON Decoder in SWIFT even after changing the fields to match?

我正在嘗試使用 SWIFT JSONDecocder 來解碼來自 API 的天氣信息,具體來說是開放天氣 API。 我已經為需要從 API 中提取的信息創建了結構。

錯誤是:

typeMismatch(Swift.Dictionary<Swift.String, Any>, Swift.DecodingError.Context(codingPath: [CodingKeys(stringValue: "daily", intValue: nil)], debugDescription: "預期解碼 Dictionary<String, Any> 但發現一個數組。”,underlyingError: nil))

這是我的結構

struct WeatherResponse: Codable {
let lat: Float
let lon: Float
let timezone: String
let current: CurrentWeather
let hourly: HourlyWeather
let daily: DailyWeather
let timezone_offset: Float

struct CurrentWeather: Codable {
let dt: Double
let sunrise: Double
let sunset: Double
let temp: Double
let feels_like: Double
let pressure: Double
let humidity: Double
let dew_point: Double
let uvi: Double
let clouds: Double
let visibility: Double
let wind_speed: Double
let wind_deg: Double

struct DailyWeather: Codable {
let data: [DailyWeatherEntry]

struct DailyWeatherEntry: Codable {
let dt: Double
let sunrise: Double
let sunset: Double
let temp: Double
let feels_like: Double
let pressure: Double
let humidity: Double
let dew_point: Double
let uvi: Double
let clouds: Double
let visibility: Double
let wind_speed: Double
let wind_deg: Double
 // let main: String
 // let description: String

struct HourlyWeather: Codable {
//let summary: String
//let icon: String
let data: [HourlyWeatherEntry]


struct HourlyWeatherEntry: Codable {
let dt: Double
let sunrise: Double
let sunset: Double
let temp: Double
let feels_like: Double
let pressure: Double
let humidity: Double
let dew_point: Double
let uvi: Double
let clouds: Double
let visibility: Double
let wind_speed: Double
let wind_deg: Double

錯誤出現在這一行

var json: WeatherResponse?
        do {
            json = try JSONDecoder().decode(WeatherResponse.self, from: data)
        }
        catch {
            print("error: \(error)")
        }
        
        guard let result = json else {
            return
        }

我在其他帖子中讀到過將我的“WeatherResponse”放在方括號中以使其成為數組,但這會導致以下錯誤“無法將“[WeatherResponse]”類型的值分配給“WeatherResponse?”。 何時放置“天氣響應?” 在方括號中,它使結構無效。

這是我試圖解碼的數據的一部分:

"lat": 40.12,
"lon": -96.66,
"timezone": "America/Chicago",
"timezone_offset": -18000,
"current": {
"dt": 1595243443,
"sunrise": 1595243663,
"sunset": 1595296278,
"temp": 293.28,
"feels_like": 293.82,
"pressure": 1016,
"humidity": 100,
"dew_point": 293.28,
"uvi": 10.64,
"clouds": 90,
"visibility": 10000,
"wind_speed": 4.6,
"wind_deg": 310,

它每小時和每天都以這種方式繼續。

我對這一切都不熟悉,我一直在尋找幾個小時試圖解決這個問題。 有什么建議嗎?

確保您將 JSONDecoder keyDecodingStrategy設置為.convertFromSnakeCase並且您的數據結構如下所示:


Root.swift 文件內容

import Foundation

struct Root: Codable {
    let lat, lon: Double
    let timezone: String
    let timezoneOffset: Int
    let current: Current
    let hourly: [Current]
    let daily: [Daily]
}

struct Current: Codable {
    let dt: Int
    let sunrise, sunset: Int?
    let temp, feelsLike: Double
    let pressure, humidity: Int
    let dewPoint: Double
    let uvi: Double?
    let clouds, visibility: Int
    let windSpeed: Double
    let windDeg: Int
    let weather: [Weather]
    let pop: Int?
}

struct Weather: Codable {
    let id: Int
    let main: Main
    let weatherDescription: Description
    let icon: Icon
    enum CodingKeys: String, CodingKey {
        case id, main, weatherDescription = "description", icon
    }
}

enum Icon: String, Codable {
    case the01D = "01d"
    case the01N = "01n"
    case the02D = "02d"
}

enum Main: String, Codable {
    case clear = "Clear", clouds = "Clouds"
}

enum Description: String, Codable {
    case clearSky = "clear sky", fewClouds = "few clouds"
}

struct Daily: Codable {
    let dt, sunrise, sunset: Int
    let temp: Temp
    let feelsLike: FeelsLike
    let pressure, humidity: Int
    let dewPoint, windSpeed: Double
    let windDeg: Int
    let weather: [Weather]
    let clouds, pop: Int
    let uvi: Double
}

struct FeelsLike: Codable {
    let day, night, eve, morn: Double
}

struct Temp: Codable {
    let day, min, max, night, eve, morn: Double
}


ViewController.swift(您的視圖控制器內容)

import UIKit

class ViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
        URLSession.shared.dataTask(with: URL(string: "https://api.openweathermap.org/data/2.5/onecall?lat=33.577862&lon=-101.855164&exclude=minutely&appid=1f16d9e6e4ff81acde25f67581255208")!) { data, response, error in
            guard let data = data else {
                print("URLSession error:", error ?? "")
                return
            }
            do {
                let decoder = JSONDecoder()
                decoder.keyDecodingStrategy = .convertFromSnakeCase
                let root = try decoder.decode(Root.self, from: data)
                print("Root:", root)
            } catch {
                print("JSONDecoder error:", error)
            }
        }.resume()
    }
}

這將打印:

根:根(緯度:33.58,經度:-101.86,時區:“美國/芝加哥”,時區偏移:-18000,當前:OpenWeather.Current(dt:1601440148,日出:可選(1601383240),日落:1609(可選)2 temp:291.04,feelLike:286.21,壓力:1021,濕度:25,露點:271.03,uvi:可選(7.27),雲:1,能見度:10000,windSpeed:3.6,windDeg:220,天氣:[WeatherOpenWeather id:800,主要:OpenWeather.Main.clear,weatherDescription:OpenWeather.Description.clearSky,圖標:OpenWeather.Icon.the01N)],pop:nil),每小時:[OpenWeather.Current(dt:1601438400,sunrise:nil,日落:無,溫度:291.04,感覺:285.41,壓力:1021,濕度:25,露點:271.03,紫外線:無,雲:1,能見度:10000,windSpeed:4.74,windDeg:244,天氣:[OpenWeathera (id: 800, main: OpenWeather.Main.clear, weatherDescription: OpenWeather.Description.clearSky, icon: OpenWeather.Icon.the01N)], pop: Optional(0)), OpenWeather.Current(dt: 1601442000, 日出: nil ,日落:無,溫度:290.28, FeelLike:284.8,壓力:1020,濕度:28,露點:271.81,uvi:無,雲:1,能見度:10000,windSpeed:4.69,windDeg:252,天氣:[OpenWeather.Weather(id:800,主要:OpenWeather) .Main.clear, weatherDescription: OpenWeather.Description.clearSky, icon: OpenWeather.Icon.the01N)], pop: Optional(0)), OpenWeather.Current(dt: 1601445600, 日出: nil, 日落: nil, temp: 289.39 ,feelLike:283.96,壓力:1019,濕度:31,露點:272.36,uvi:零,雲:0,能見度:10000,windSpeed:4.73,windDeg:257,天氣:[OpenWeather.Weather,主要ID:800 OpenWeather.Main.clear, weatherDescription: OpenWeather.Description.clearSky, icon: OpenWeather.Icon.the01N)], pop: Optional(0)), OpenWeather.Current(dt: 1601449200, 日出: nil, 日落: nil, temp: 288.53,feelLike:283.17,壓力:1018,濕度:33,露點:272.45,uvi:無,雲:0,能見度:10000,windSpeed:4.66,windDeg:261,天氣:[OpenWeather:. : OpenWeather.Main.clear, weatherDecri 選項:OpenWeather.Description.clearSky,圖標:OpenWeather.Icon.the01N)],彈出:可選(0)),OpenWeather.Current(dt:1601452800,日出:無,日落:無,溫度:287.96,feelLike:282.57,壓力:1018,濕度:34,露點:272.37,紫外線:零,雲:0,能見度:10000,windSpeed:4.68,windDeg:261,天氣:[OpenWeather.Weather(id:800,主要:OpenWeather.Main.clear , weatherDescription: OpenWeather.Description.clearSky, icon: OpenWeather.Icon.the01N)], pop: Optional(0)), OpenWeather.Current(dt: 1601456400, 日出: nil, 日落: nil, temp: 287.53, FeelLike: 282.2 ,壓力:1017,濕度:35,露點:270.43,紫外線:零,雲:0,能見度:10000,windSpeed:4.6,windDeg:262,天氣:[OpenWeather.Weather(id: 800, main: OpenWeather.Main.晴朗,weatherDescription:OpenWeather.Description.clearSky,圖標:OpenWeather.Icon.the01N)],pop:Optional(0)),OpenWeather.Current(dt:1601460000,日出:nil,日落:nil,temp:287.1,feelLike: 281.93,壓力:1017,濕度:36,dewP oint:270.54,uvi:nil,雲:0,能見度:10000,windSpeed:4.37,windDeg:263,天氣:[OpenWeather.Weather(id:800,主要:OpenWeather.Main.clear,weatherDescription:OpenWeather.Description.clearSky , icon: OpenWeather.Icon.the01N)], pop: Optional(0)), OpenWeather.Current(dt: 1601463600,日出:nil,日落:nil,temp:286.69,feelLike:281.73,壓力:1017,濕度:37 ,露點:270.74,uvi:無,雲:0,能見度:10000,windSpeed:4.07,windDeg:270,天氣:[OpenWeather.Weather(id:800,主要:OpenWeather.Main.clear,weatherDescription:OpenWeather.Description。 clearSky, icon: OpenWeather.Icon.the01N)], pop: Optional(0)), OpenWeather.Current(dt: 1601467200, 日出:nil,日落:nil,temp:286.41,feelLike:281.64,壓力:1018,濕度: 38,露點:270.88,uvi:無,雲:0,能見度:10000,windSpeed:3.82,windDeg:277,天氣:[OpenWeather.Weather(id:800,主要:OpenWeather.Main.clear,weatherDescription:OpenWeather.Description .clearSky,圖標:OpenWe ather.Icon.the01N)], pop: Optional(0)), OpenWeather.Current(dt: 1601470800, 日出:nil,日落:nil,溫度:286.51,feelLike:281.83,壓力:1018,濕度:38,露點: 271.26,uvi:nil,雲:0,能見度:10000,windSpeed:3.71,windDeg:279,天氣:[OpenWeather.Weather(id:800,主要:OpenWeather.Main.clear,weatherDescription:OpenWeather.Description.clearSky,圖標: OpenWeather.Icon.the01D)], pop: Optional(0)), OpenWeather.Current(dt: 1601474400,日出:無,日落:無,溫度:289.71,feelLike:285.15,壓力:1018,濕度:32,露點:272.49,uvi:nil,雲:0,能見度:10000,windSpeed:3.64,windDeg:278,天氣:[OpenWeather.Weather(id:800,主要:OpenWeather.Main.clear,weatherDescription:OpenWeather.Description.clearSky, icon: OpenWeather.Icon.the01D)], pop: Optional(0)), OpenWeather.Current(dt: 1601478000, 日出:nil,日落:nil,溫度:293.97,feelLike:289.25,壓力:1018,濕度:24,露點:273.19,紫外線:零,雲:0,能見度:100 00,windSpeed:3.81,windDeg:282,天氣:[OpenWeather.Weather(id:800,主要:OpenWeather.Main.clear,weatherDescription:OpenWeather.Description.clearSky,圖標:OpenWeather.Icon.the01D)],pop:可選(0)), OpenWeather.Current(dt: 1601481600, 日出: nil, 日落: nil, temp: 297.38, FeelLike: 292.99, 壓力: 1017, 濕度: 20, dewPoint: 273.51, uvi: nil, 雲彩: 0, :10000,windSpeed:3.4,windDeg:286,天氣:[OpenWeather.Weather(id:800,主要:OpenWeather.Main.clear,weatherDescription:OpenWeather.Description.clearSky,圖標:OpenWeather.Icon.the01D)],pop:可選(0)),OpenWeather.Current(dt:1601485200,日出:無,日落:無,溫度:300.14,feelLike:296.44,壓力:1017,濕度:17,露點:273.23,uvi:無,雲:能見度:10000,windSpeed:2.42,windDeg:280,天氣:[OpenWeather.Weather(id:800,主要:OpenWeather.Main.clear,weatherDescription:OpenWeather.Description.clearSky,圖標:OpenWeather.Icon.the01D)],pop : 可選(0)), OpenWeather .Current(dt:1601488800,日出:無,日落:無,溫度:302.28,feelLike:299.17,壓力:1016,濕度:15,露點:272.68,紫外線:無,雲:0,能見度:風85:10010。 , windDeg: 260, 天氣: [OpenWeather.Weather(id: 800, main: OpenWeather.Main.clear, weatherDescription: OpenWeather.Description.clearSky, icon: OpenWeather.Icon.the01D)], pop: Optional(0)), OpenWeather.Current(dt:1601492400,日出:無,日落:無,溫度:303.72,feelLike:300.76,壓力:1015,濕度:13,露點:272.3,紫外線:無,雲:0,能見度0,風:100: 1.19,windDeg:217,天氣:[OpenWeather.Weather(id:800,main:OpenWeather.Main.clear,weatherDescription:OpenWeather.Description.clearSky,圖標:OpenWeather.Icon.the01D)],pop:Optional(0)) , OpenWeather.Current(dt: 1601496000, 日出: nil, 日落: nil, temp: 304.34, FeelLike: 301.38, 壓力: 1014, 濕度: 13, dewPoint: 271.9, uvi: nil, 雲: 0, 0 能見度0, 10 :1.29,windDeg:183,天氣:[OpenWeat her.Weather(id: 800, main: OpenWeather.Main.clear, weatherDescription: OpenWeather.Description.clearSky, icon: OpenWeather.Icon.the01D)], pop: Optional(0)), OpenWeather.Current(dt: 1601499600,日出:無,日落:無,溫度:304.58,feelLike:301.36,壓力:1013,濕度:12,露點:271.52,uvi:無,雲:0,能見度:10000,windSpeed:1.48,windDeg:151,天氣[OpenWeather.Weather(id: 800, main: OpenWeather.Main.clear, weatherDescription: OpenWeather.Description.clearSky, icon: OpenWeather.Icon.the01D)], pop: Optional(0)), OpenWeather.Current(dt: 1601503200 ,日出:無,日落:無,溫度:304.48,feelLike:300.82,壓力:1013,濕度:12,露點:271.4,uvi:無,雲:0,能見度:10000,windSpeed:2.09,windDeg:132 : [OpenWeather.Weather(id: 800, main: OpenWeather.Main.clear, weatherDescription: OpenWeather.Description.clearSky, icon: OpenWeather.Icon.the01D)], pop: Optional(0)), OpenWeather.Current(dt: 1601506800,日出:無,日落:無,t emp:304.03,feelLike:299.8,壓力:1013,濕度:13,露點:272.04,uvi:零,雲:0,能見度:10000,windSpeed:3.06,windDeg:130,天氣:[OpenWeather:272.04 , main: OpenWeather.Main.clear, weatherDescription: OpenWeather.Description.clearSky, icon: OpenWeather.Icon.the01D)], pop: Optional(0)), OpenWeather.Current(dt: 1601510400, 日出: nil, 日落: nil ,溫度:300.26,feelLike:295.85,壓力:1013,濕度:18,露點:274.22,uvi:零,雲:0,能見度:10000,windSpeed:3.62,windDeg:140,天氣:[OpenWeather(OpenWeather. 800, main: OpenWeather.Main.clear, weatherDescription: OpenWeather.Description.clearSky, icon: OpenWeather.Icon.the01D)], pop: Optional(0)), OpenWeather.Current(dt: 1601514000, 日出: nil, 日落:零,溫度:296.09,感覺:291.46,壓力:1015,濕度:22,露點:273.71,紫外線:零,雲:0,能見度:10000,windSpeed:3.79,windDeg:153,天氣:[OpenWeather. : 800, 主要: OpenWeather.Main.clear, w EatherDescription: OpenWeather.Description.clearSky, icon: OpenWeather.Icon.the01N)], pop: Optional(0)), OpenWeather.Current(dt: 1601517600, 日出: nil, 日落: nil, temp: 294.45, FeelLike: 290.18壓力:1016,濕度:24,露點:273.45,紫外線:零,雲:0,能見度:10000,windSpeed:3.24,windDeg:151,天氣:[OpenWeather.Weather(id:800,主要:OpenWeather.Main.clear , weatherDescription: OpenWeather.Description.clearSky, icon: OpenWeather.Icon.the01N)], pop: Optional(0)), OpenWeather.Current(dt: 1601521200, 日出: nil, 日落: nil, temp: 292.95, FeelLike: 288.88. ,壓力:1017,濕度:26,露點:273.15,紫外線:零,雲:0,能見度:10000,windSpeed:2.94,windDeg:152,天氣:[OpenWeather.Weather(id: 800, main: OpenWeather.Main.晴朗,weatherDescription:OpenWeather.Description.clearSky,圖標:OpenWeather.Icon.the01N)],pop:Optional(0)),OpenWeather.Current(dt:1601524800,日出:nil,日落:nil,temp:291.67,feelLike: 287.75,壓力:1018,嗯 idity:28,dewPoint:272.9,uvi:nil,雲:0,能見度:10000,windSpeed:2.69,windDeg:176,天氣:[OpenWeather.Weather(id:800,主要:OpenWeather.Main.clear,weatherDescription:OpenWeather .Description.clearSky, icon: OpenWeather.Icon.the01N)], pop: Optional(0)), OpenWeather.Current(dt: 1601528400, 日出:nil,日落:nil,temp:290.77,feelLike:286.95,壓力:1018 ,濕度:30,露點:272.65,uvi:零,雲:0,能見度:10000,windSpeed:2.59,windDeg:198,天氣:[OpenWeather.Weather(id:800,主要:OpenWeather.Main.clear,weatherDescription: OpenWeather.Description.clearSky, icon: OpenWeather.Icon.the01N)], pop: Optional(0)), OpenWeather.Current(dt: 1601532000, 日出:nil,日落:nil,temp:289.91,feelLike:286.19,壓力: 1018,濕度:31,露點:272.52,uvi:無,雲:0,能見度:10000,windSpeed:2.38,windDeg:205,天氣:[OpenWeather.Weather(id:800,主要:OpenWeather.Main.clear,weatherDescription) : OpenWeather.Description.clearSky , icon: OpenWeather.Icon.the01N)], pop: Optional(0)), OpenWeather.Current(dt: 1601535600, 日出:nil,日落:nil,temp:288.33,feelLike:285.37,壓力:1019,濕度:35 ,露點:272.56,uvi:無,雲:0,能見度:10000,windSpeed:1.36,windDeg:200,天氣:[OpenWeather.Weather(id:800,主要:OpenWeather.Main.clear,weatherDescription:OpenWeather.Description。 clearSky, icon: OpenWeather.Icon.the01N)], pop: Optional(0)), OpenWeather.Current(dt: 1601539200, 日出:nil,日落:nil,temp:287.81,feelLike:284.97,壓力:1019,濕度: 36,露點:272.54,uvi:無,雲:0,能見度:10000,windSpeed:1.17,windDeg:196,天氣:[OpenWeather.Weather(id:800,主要:OpenWeather.Main.clear,weatherDescription:OpenWeather.Description .clearSky, icon: OpenWeather.Icon.the01N)], pop: Optional(0)), OpenWeather.Current(dt: 1601542800, 日出:nil,日落:nil,溫度:287.24,feelLike:285.09,壓力:1019,濕度: 37, 露點: 272.37, uvi: nil, 雲: 0, v isibility: 10000, windSpeed: 0.15, windDeg: 229, 天氣: [OpenWeather.Weather(id: 800, main: OpenWeather.Main.clear, weatherDescription: OpenWeather.Description.clearSky, icon: OpenWeather.Icon.the01N)], pop :可選(0)),OpenWeather.Current(dt:1601546400,日出:無,日落:無,溫度:287.0,feelLike:283.93,壓力:1019,濕度:38,露點:272.37,uvi:無,雲,能見度:10000,windSpeed:1.5,windDeg:42,天氣:[OpenWeather.Weather(id:800,主要:OpenWeather.Main.clear,weatherDescription:OpenWeather.Description.clearSky,圖標:OpenWeather.Icon.the01N)], pop: Optional(0)), OpenWeather.Current(dt: 1601550000, 日出: nil, 日落: nil, temp: 286.72, FeelLike: 283.0, 壓力: 1020, 濕度: 39, dewPoint: 273.04, uvi: nil,clouds 0,能見度:10000,windSpeed:2.45,windDeg:56,天氣:[OpenWeather.Weather(id:800,主要:OpenWeather.Main.clear,weatherDescription:OpenWeather.Description.clearSky,圖標:OpenWeather.Icon.the01N)] , 彈出: 可選(0)), O penWeather.Current(dt:16015536​​00,日出:無,日落:無,溫度:286.31,feelLike:282.44,壓力:1021,濕度:45,露點:274.67,紫外線:無,雲:0,速度:10 3.02,windDeg:65,天氣:[OpenWeather.Weather(id:800,main:OpenWeather.Main.clear,weatherDescription:OpenWeather.Description.clearSky,圖標:OpenWeather.Icon.the01N)],pop:Optional(0)) , OpenWeather.Current(dt: 1601557200, 日出: 無, 日落: 無, 溫度: 286.12, FeelLike: 282.47, 壓力: 1021, 濕度: 53, 露點: 276.97, 紫外線: 無, 雲: 0,0 能見度, 1 : 3.23, windDeg: 67, 天氣: [OpenWeather.Weather(id: 800, main: OpenWeather.Main.clear, weatherDescription: OpenWeather.Description.clearSky, icon: OpenWeather.Icon.the01D)], pop: Optional(0) ),OpenWeather.Current(dt:1601560800,日出:無,日落:無,溫度:288.85,feelLike:285.41,壓力:1022,濕度:52,露點:279.13,紫外線:無,雲:10,0 能見度:0風速:3.57,風度:64,天氣: [OpenWeather.Weather(id: 800, main: OpenWeather.Main.clear, weatherDescription: OpenWeather.Description.clearSky, icon: OpenWeather.Icon.the01D)], pop: Optional(0)), OpenWeather.Current(dt: 1601564400 ,日出:無,日落:無,溫度:292.06,感覺:288.41,壓力:1023,濕度:45,露點:280.04,uvi:無,雲:0,能見度:10000,windSpeed:4.13,windDeg:65 : [OpenWeather.Weather(id: 800, main: OpenWeather.Main.clear, weatherDescription: OpenWeather.Description.clearSky, icon: OpenWeather.Icon.the01D)], pop: Optional(0)), OpenWeather.Current(dt: 1601568000,日出:無,日落:無,溫度:294.81,feelLike:290.96,壓力:1023,濕度:37,露點:279.81,uvi:無,雲:0,能見度:10000,wind9Speed,wind,Deg:4。天氣:[OpenWeather.Weather(id: 800, main: OpenWeather.Main.clear, weatherDescription: OpenWeather.Description.clearSky, icon: OpenWeather.Icon.the01D)], pop: Optional(0)), OpenWeather.Current(dt) : 1601571600, 日出: 無, 日落 :零,溫度:297.16,感覺:292.98,壓力:1022,濕度:31,露點:279.43,紫外線:零,雲:0,能見度:10000,windSpeed:4.61,windDeg:78,天氣:[OpenWea(OpenWea) id:800,主要:OpenWeather.Main.clear,weatherDescription:OpenWeather.Description.clearSky,圖標:OpenWeather.Icon.the01D)],pop:Optional(0)),OpenWeather.Current(dt:1601575200,sunrise:nil,日落:無,溫度:298.92,感覺:294.36,壓力:1022,濕度:28,露點:279.09,紫外線:無,雲:0,能見度:10000,windSpeed:5.17,windDeg:82,天氣:[OpenWeathera (id: 800, main: OpenWeather.Main.clear, weatherDescription: OpenWeather.Description.clearSky, icon: OpenWeather.Icon.the01D)], pop: Optional(0)), OpenWeather.Current(dt: 1601578800, 日出: nil ,日落:無,溫度:299.91,feelLike:295.12,壓力:1021,濕度:25,露點:278.51,uvi:無,雲:0,能見度:10000,windSpeed:5.26,windDeg:93,天氣:[OpenWeather。天氣(ID:800,主要:OpenWeather.Main.cl 耳朵,weatherDescription:OpenWeather.Description.clearSky,圖標:OpenWeather.Icon.the01D)],pop:可選(0)),OpenWeather.Current(dt:1601582400,日出:nil,日落:nil,temp:300.4,feelLike: 295.64,氣壓:1020,濕度:23,露點:278.02,uvi:零,雲:0,能見度:10000,windSpeed:4.99,windDeg:103,天氣:[OpenWeather.Weather(id: 800, main: OpenWeather) .clear, weatherDescription: OpenWeather.Description.clearSky, icon: OpenWeather.Icon.the01D)], pop: Optional(0)), OpenWeather.Current(dt: 1601586000, 日出:nil,日落:nil,temp:300.56,feelLike :295.8,壓力:1019,濕度:23,露點:277.8,uvi:零,雲:0,能見度:10000,windSpeed:5.04,windDeg:110,天氣:[OpenWeather.Weather(id:800,主要:OpenWeather) Main.clear, weatherDescription: OpenWeather.Description.clearSky, icon: OpenWeather.Icon.the01D)], pop: Optional(0)), OpenWeather.Current(dt: 1601589600, 日出: nil, 日落: nil, temp: 300.24,感覺:295.29,壓力:1019, 濕度:23,露點:277.77,紫外線:零,雲:0,能見度:10000,windSpeed:5.23,windDeg:110,天氣:[OpenWeather.Weather(id:800,主要:OpenWeather.Main.clear,weatherDescription:OpenWeather .Description.clearSky, icon: OpenWeather.Icon.the01D)], pop: Optional(0)), OpenWeather.Current(dt: 1601593200, 日出:nil,日落:nil,temp:299.16,feelLike:294.0,壓力:1019 ,濕度:26,露點:278.24,紫外線:零,雲:0,能見度:10000,windSpeed:5.76,windDeg:104,天氣:[OpenWeather.Weather(id:800,主要:OpenWeather.Main.clear,weatherDescription: OpenWeather.Description.clearSky,圖標:OpenWeather.Icon.the01D)],pop:Optional(0)),OpenWeather.Current(dt:1601596800,日出:nil,日落:nil,temp:296.55,feelLike:291.34,壓力: 1019,濕度:35,露點:280.25,uvi:零,雲:0,能見度:10000,windSpeed:6.47,windDeg:95,天氣:[OpenWeather.Weather(id:800,主要:OpenWeather.Main.clear,weatherDescription) : OpenWeather.Description.clearS ky,圖標:OpenWeather.Icon.the01D)],pop:可選(0)),OpenWeather.Current(dt:1601600400,日出:無,日落:無,溫度:293.36,feelLike:288.17,壓力:1020,濕度: 45,露點:281.38,uvi:無,雲:0,能見度:10000,windSpeed:6.71,windDeg:94,天氣:[OpenWeather.Weather(id:800,主要:OpenWeather.Main.clear,weatherDescription:OpenWeather.Description) .clearSky, icon: OpenWeather.Icon.the01N)], pop: Optional(0)), OpenWeather.Current(dt: 1601604000, 日出:nil,日落:nil,溫度:292.11,feelLike:286.49,壓力:1021,濕度:49,露點:281.3,uvi:無,雲:0,能見度:10000,windSpeed:7.37,windDeg:100,天氣:[OpenWeather.Weather(id:800,主要:OpenWeather.Main.clear,weatherDescription:OpenWeather. Description.clearSky, icon: OpenWeather.Icon.the01N)], pop: Optional(0)), OpenWeather.Current(dt: 1601607600, 日出: nil, 日落: nil, temp: 290.93, FeelLike: 285.05, pressure: 1023,濕度:54,露點:281.61,紫外線:零,雲:0,v isibility: 10000, windSpeed: 7.85, windDeg: 104, 天氣: [OpenWeather.Weather(id: 800, main: OpenWeather.Main.clear, weatherDescription: OpenWeather.Description.clearSky, icon: OpenWeather.Icon.the01N)], pop :可選(0))],每天:[OpenWeather.Daily(dt:1601402400,日出:1601383240,日落:1601426059,溫度:OpenWeather.Temp(白天:297.29,分鍾:281.496:4,29:12夜) : 296.25, 早晨: 283.22), FeelLike: OpenWeather.FeelsLike(day: 291.77, night: 285.61, eve: 292.14, morn: 277.07), 氣壓:1022,濕度:18,風速:18,風速:4262727w。 , 天氣: [OpenWeather.Weather(id: 801, main: OpenWeather.Main.clouds, weatherDescription: OpenWeather.Description.fewClouds, icon: OpenWeather.Icon.the02D)], 雲彩: 14, pop: 0, uvi: 7.27) , OpenWeather.Daily(dt: 1601488800, 日出: 1601469681, 日落: 1601512377, temp: OpenWeather.Temp(day: 302.28, min: 286.71, max: 304.52, night: 9,607n. OpenWeather.FeelsLike(day: 299.17, nig ht:288.87,eve:295.85,morn:281.98),壓力:1016,濕度:15,露點:272.68,windSpeed:1.58,windDeg:260,天氣:[OpenWeather.Weather,主要:OpenWeather(id:800)晴,weatherDescription:OpenWeather.Description.clearSky,圖標:OpenWeather.Icon.the01D)],雲:0,流行:0,uvi:7.17),OpenWeather.Daily(dt:1601575200,日出:1601556123,15 溫度96 日落:16 : OpenWeather.Temp(day: 298.92, min: 286.31, max: 300.56, night: 290.93, eve: 296.55, morn: 286.31), feelLike: OpenWeather.FeelsLike(day: 294.20.56, eve: 295.283.4 282.44),壓力:1022,濕度:28,露點:279.09,windSpeed:5.17,windDeg:82,天氣:[OpenWeather.Weather(id:800,主要:OpenWeather.Main.clear,weatherDescription:OpenWeather.Description.clearSky圖標:OpenWeather.Icon.the01D)],雲:0,流行:0,uvi:6.8),OpenWeather.Daily(dt:1601661600,日出:1601642565,日落:1601685013,溫度:OpenWeather,29分鍾。 :283.69,最大:300.93,夜間:292.55,前夕:297。 55,早上:283.69),feelLike:OpenWeather.FeelsLike(白天:291.25,晚上:287.4,前夜:292.2,早上:280.29),壓力:1018,濕度:26,露點:2737,風速,風速:87。天氣:[OpenWeather.Weather(id:800,主要:OpenWeather.Main.clear,weatherDescription:OpenWeather.Description.clearSky,圖標:OpenWeather.Icon.the01D)],雲:8,流行:0,uvi:6.53), OpenWeather.Daily(dt: 1601748000, 日出: 1601729008, 日落: 1601771332, 溫度: OpenWeather.Temp(day: 301.18, min: 287.43, max: 304.98, night, eve.303.,703. OpenWeather: 2903) .FeelsLike(day: 296.21, night: 288.26, eve: 298.01,morn: 283.24), 氣壓: 1010, 濕度: 20, 露點: 276.76, windSpeed: 4.94, windDeg: 230Wethera, [天氣: [天氣: ,主要:OpenWeather.Main.clear,weatherDescription:OpenWeather.Description.clearSky,圖標:OpenWeather.Icon.the01D)],雲:1,pop:0,uvi:6.67),OpenWeather.Daily(dt:1601834400,日出: 1601815451,日落:1601857651,溫度:OpenWeather.Te mp(day: 299.81, min: 286.06, max: 303.41, night: 294.89, eve: 299.49, morn: 286.06), FeelLike: OpenWeather.FeelsLike(day: 297.03, night: 2,2.590: 290:290)壓力:1016,濕度:28,露點:280.2,windSpeed:2.86,windDeg:138,天氣:[OpenWeather.Weather(id:800,主要:OpenWeather.Main.clear,weatherDescription:OpenWeather.Description.clearSky,圖標:OpenWeather .Icon.the01D)], 雲: 0, pop: 0, uvi: 6.48), OpenWeather.Daily(dt: 1601920800, 日出: 1601901894, 日落: 1601943971, temp: OpenWeather.Temp:1.4,180.Temp(day:18,3000)最大:304.02,夜間:295.44,前夕:299.96,上午:288.91),feelLike:OpenWeather.FeelsLike(白天:294.87,夜間:288.51,前夕:293.19,上午:45:20, 氣壓:285 點) 280.61,windSpeed:8.32,windDeg:202,天氣:[OpenWeather.Weather(id:800,主要:OpenWeather.Main.clear,weatherDescription:OpenWeather.Description.clearSky,圖標:OpenWeather.Icon.the01D)],雲:0 , pop: 0, uvi: 6.81), OpenWeather.Daily(dt: 1602 007200, 日出: 1601988337, 日落: 1602030292, 溫度: OpenWeather.Temp(day: 302.74, min: 288.12, max: 306.48, night: 295.14, eve: 3mord: 1602030292, OpenWeather.Temp(day: 302.74, min: 288.12, max: 306.48, night: 295.14, eve: 3mord: 1602030292), 9Feeliken.7thern.02.06(007.06), 98天: 18 天 1 月,晚上:290.36,前夕:295.96,早上:283.96),氣壓:1012,濕度:16,露點:275.12,windSpeed:2.64,windDeg:237,天氣:[OpenWeather.Main.Weather,主要:OpenWea00 .clear,weatherDescription:OpenWeather.Description.clearSky,圖標:OpenWeather.Icon.the01D)],雲:0,pop:0,uvi:6.68)])

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM