---
title: "encode(to:)"
framework: weatherkit
role: symbol
role_heading: Instance Method
path: "weatherkit/forecast/encode(to:)-fbco"
---

# encode(to:)

## Declaration

```swift
func encode(to encoder: any Encoder) throws
```

## See Also

### Serializing objects

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