---
title: Forecast
framework: weatherkit
role: symbol
role_heading: Structure
path: weatherkit/forecast
---

# Forecast

A forecast collection for minute, hourly, and daily forecasts.

## Declaration

```swift
struct Forecast<Element> where Element : Decodable, Element : Encodable, Element : Equatable, Element : Sendable
```

## Overview

Overview Forecast conforms to the RandomAccessCollection protocol to support efficient random-access index traversal through forecast types. The protocol involves forwarding the required properties and methods to the underlying forecast collection. The implementation of subscript returns an instance of the Element type.

## Topics

### Creating the forecast

- [init(from:)](weatherkit/forecast/init(from:)-390k1.md)
- [init(from:)](weatherkit/forecast/init(from:)-4wobg.md)

### Serializing objects

- [encode(to:)](weatherkit/forecast/encode(to:)-5zuqd.md)
- [encode(to:)](weatherkit/forecast/encode(to:)-fbco.md)

### Getting the properties

- [endIndex](weatherkit/forecast/endindex.md)
- [forecast](weatherkit/forecast/forecast.md)
- [metadata](weatherkit/forecast/metadata.md)
- [startIndex](weatherkit/forecast/startindex.md)
- [summary](weatherkit/forecast/summary.md)

### Accessing elements

- [subscript(_:)](weatherkit/forecast/subscript(_:).md)
- [Forecast.Index](weatherkit/forecast/index.md)

### Comparing forecasts

- [==(_:_:)](weatherkit/forecast/==(_:_:).md)

## Relationships

### Conforms To

- [BidirectionalCollection](swift/bidirectionalcollection.md)
- [Collection](swift/collection.md)
- [Decodable](swift/decodable.md)
- [Encodable](swift/encodable.md)
- [Equatable](swift/equatable.md)
- [RandomAccessCollection](swift/randomaccesscollection.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)
- [Sequence](swift/sequence.md)

## See Also

### Alerts and forecasts

- [WeatherAlert](weatherkit/weatheralert.md)
- [WeatherAvailability](weatherkit/weatheravailability.md)
- [MinuteWeather](weatherkit/minuteweather.md)
- [HourWeather](weatherkit/hourweather.md)
- [DayWeather](weatherkit/dayweather.md)
