attribution
TypeScriptget attribution(): Promise<WeatherAttribution>Swift declarationfinal var attribution: WeatherAttribution { get async throws }The required attribution which includes a legal attribution page and Apple Weather mark.
class · iOS 16.0+ · SDK 27.1
final class WeatherServiceProvides an interface for obtaining weather data.
get attribution(): Promise<WeatherAttribution>Swift declarationfinal var attribution: WeatherAttribution { get async throws }The required attribution which includes a legal attribution page and Apple Weather mark.
static get shared(): WeatherServiceSwift declarationstatic let shared: WeatherServiceA single, shared weather service object. Use this object to interface to weather services in your application. If you need to prioritize weather information, create separate instances with `init`.
weatherForIncluding(location: __LocationEssentials_CLLocation, dataSet1: WeatherQuery<number>, dataSet2: WeatherQuery<number>, dataSet3: WeatherQuery<number>, dataSet4: WeatherQuery<number>, dataSet5: WeatherQuery<number>, dataSet6: WeatherQuery<number>): Promise<[number, number, number, number, number, number]>Swift declaration@preconcurrency final func weather<T1, T2, T3, T4, T5, T6>(for location: CLLocation, including dataSet1: WeatherQuery<T1>, _ dataSet2: WeatherQuery<T2>, _ dataSet3: WeatherQuery<T3>, _ dataSet4: WeatherQuery<T4>, _ dataSet5: WeatherQuery<T5>, _ dataSet6: WeatherQuery<T6>) async throws -> (T1, T2, T3, T4, T5, T6) where T1 : Sendable, T2 : Sendable, T3 : Sendable, T4 : Sendable, T5 : Sendable, T6 : SendableReturns the weather forecast for the requested location. - Parameter location: The requested location. - Throws: Weather data error `WeatherError` - Returns: The requested weather data set. This is a variadic API in which any combination of data sets can be requested and returned as a tuple. Here's an example: ``` `let (current, minute, hourly, daily, alerts) = try await service.weather(for: newYork, including: .current, .minute, .hourly, .daily, .alerts)` ```
weatherForIncluding11867(location: __LocationEssentials_CLLocation, dataSet1: WeatherQuery<number>, dataSet2: WeatherQuery<number>, dataSet3: WeatherQuery<number>, dataSet4: WeatherQuery<number>, dataSet5: WeatherQuery<number>): Promise<[number, number, number, number, number]>Swift declaration@preconcurrency final func weather<T1, T2, T3, T4, T5>(for location: CLLocation, including dataSet1: WeatherQuery<T1>, _ dataSet2: WeatherQuery<T2>, _ dataSet3: WeatherQuery<T3>, _ dataSet4: WeatherQuery<T4>, _ dataSet5: WeatherQuery<T5>) async throws -> (T1, T2, T3, T4, T5) where T1 : Sendable, T2 : Sendable, T3 : Sendable, T4 : Sendable, T5 : SendableReturns the weather forecast for the requested location. - Parameter location: The requested location. - Throws: Weather data error `WeatherError` - Returns: The requested weather data set. This is a variadic API in which any combination of data sets can be requested and returned as a tuple. Here's an example: ``` let (current, minute, hourly, daily, alerts) = try await service.weather(for: newYork, including: .current, .minute, .hourly, .daily, .alerts) ```
weatherForIncluding48270(location: __LocationEssentials_CLLocation, dataSet1: WeatherQuery<number>, dataSet2: WeatherQuery<number>, dataSet3: WeatherQuery<number>, dataSet4: WeatherQuery<number>): Promise<[number, number, number, number]>Swift declaration@preconcurrency final func weather<T1, T2, T3, T4>(for location: CLLocation, including dataSet1: WeatherQuery<T1>, _ dataSet2: WeatherQuery<T2>, _ dataSet3: WeatherQuery<T3>, _ dataSet4: WeatherQuery<T4>) async throws -> (T1, T2, T3, T4) where T1 : Sendable, T2 : Sendable, T3 : Sendable, T4 : SendableReturns the weather forecast for the requested location. - Parameter location: The requested location. - Throws: Weather data error `WeatherError` - Returns: The requested weather data set. This is a variadic API in which any combination of data sets can be requested and returned as a tuple. Here's an example: ``` let (current, minute, hourly, daily) = try await service.weather(for: newYork, including: .current, .minute, .hourly, .daily) ```
weatherForIncluding66675(location: __LocationEssentials_CLLocation, dataSet1: WeatherQuery<number>, dataSet2: WeatherQuery<number>, dataSet3: WeatherQuery<number>): Promise<[number, number, number]>Swift declaration@preconcurrency final func weather<T1, T2, T3>(for location: CLLocation, including dataSet1: WeatherQuery<T1>, _ dataSet2: WeatherQuery<T2>, _ dataSet3: WeatherQuery<T3>) async throws -> (T1, T2, T3) where T1 : Sendable, T2 : Sendable, T3 : SendableReturns the weather forecast for the requested location. - Parameter location: The requested location. - Throws: Weather data error `WeatherError` - Returns: The requested weather data set. This is a variadic API in which any combination of data sets can be requested and returned as a tuple. Here's an example: ``` let (current, minute, hourly) = try await service.weather(for: newYork, including: .current, .minute, .hourly) ```
weatherForIncluding90072(location: __LocationEssentials_CLLocation, dataSet1: WeatherQuery<number>, dataSet2: WeatherQuery<number>): Promise<[number, number]>Swift declaration@preconcurrency final func weather<T1, T2>(for location: CLLocation, including dataSet1: WeatherQuery<T1>, _ dataSet2: WeatherQuery<T2>) async throws -> (T1, T2) where T1 : Sendable, T2 : SendableReturns the weather forecast for the requested location. - Parameter location: The requested location. - Throws: Weather data error `WeatherError` - Returns: The requested weather data set. This is a variadic API in which any combination of data sets can be requested and returned as a tuple. Here's an example: ``` let (current, minute) = try await service.weather(for: newYork, including: .current, .minute) ```
weatherForIncluding80774(location: __LocationEssentials_CLLocation, dataSet: WeatherQuery<number>): Promise<number>Swift declaration@preconcurrency final func weather<T>(for location: CLLocation, including dataSet: WeatherQuery<T>) async throws -> T where T : SendableReturns the weather forecast for the requested location. - Parameter location: The requested location. - Throws: Weather data error `WeatherError` - Returns: The requested weather data set. This is a variadic API in which any combination of data sets can be requested and returned as a tuple. Here's an example: ``` let current = try await service.weather(for: newYork, including: .current) ```
weatherFor(location: __LocationEssentials_CLLocation): Promise<Weather>Swift declarationfinal func weather(for location: CLLocation) async throws -> WeatherReturns the weather forecast for the requested location. - Parameter location: The requested location. - Throws: Weather data error `WeatherError` - Returns: The aggregate weather.
static init(): WeatherServiceSwift declarationconvenience init()Creates a weather service object. Use this method to create different `WeatherService` instances, for example, to separate out high-priority and low-priority requests for performance. If you only need one instance of `WeatherService`, use `shared`.
12 declarations were excluded from these bindings. Each reason comes from the generator or the iOS SDK compiler.
WeatherService.weather(for:including:)
Swift parameter packs cannot cross the bridge.
WeatherService.dailyStatistics(for:forDaysIn:including:)
Swift parameter packs cannot cross the bridge.
WeatherService.dailyStatistics(for:including:)
Swift parameter packs cannot cross the bridge.
WeatherService.dailyStatistics(for:startDay:endDay:including:)
Swift parameter packs cannot cross the bridge.
WeatherService.dailySummary(for:forDaysIn:including:)
Swift parameter packs cannot cross the bridge.
WeatherService.dailySummary(for:including:)
Swift parameter packs cannot cross the bridge.
WeatherService.hourlyStatistics(for:forHoursIn:including:)
Swift parameter packs cannot cross the bridge.
WeatherService.hourlyStatistics(for:including:)
Swift parameter packs cannot cross the bridge.
WeatherService.hourlyStatistics(for:startHour:endHour:including:)
Swift parameter packs cannot cross the bridge.
WeatherService.monthlyStatistics(for:including:)
Swift parameter packs cannot cross the bridge.
WeatherService.monthlyStatistics(for:forMonthsIn:including:)
Swift parameter packs cannot cross the bridge.
WeatherService.monthlyStatistics(for:startMonth:endMonth:including:)
Swift parameter packs cannot cross the bridge.