---
title: "decodeTime(forKey:)"
framework: foundation
role: symbol
role_heading: Instance Method
path: "foundation/nscoder/decodetime(forkey:)"
---

# decodeTime(forKey:)

Returns the Core Media time structure associated with a given key.

## Declaration

```swift
func decodeTime(forKey key: String) -> CMTime
```

## Parameters

- `key`: The key for a CMTime structure encoded in the receiver.

## Return Value

Return Value The CMTime structure associated with key in the archive.

## See Also

### Related Documentation

- [encode(_:forKey:)](foundation/nscoder/encode(_:forkey:)-6wbby.md)

### Decoding Core Media Time Structures

- [decodeTimeRange(forKey:)](foundation/nscoder/decodetimerange(forkey:).md)
- [decodeTimeMapping(forKey:)](foundation/nscoder/decodetimemapping(forkey:).md)
