---
title: state
framework: foundation
role: symbol
role_heading: Instance Property
path: foundation/urlsessiontask/state-swift.property
---

# state

The current state of the task—active, suspended, in the process of being canceled, or completed.

## Declaration

```swift
var state: URLSessionTask.State { get }
```

## See Also

### Controlling the task state

- [cancel()](foundation/urlsessiontask/cancel().md)
- [resume()](foundation/urlsessiontask/resume().md)
- [suspend()](foundation/urlsessiontask/suspend().md)
- [URLSessionTask.State](foundation/urlsessiontask/state-swift.enum.md)
- [priority](foundation/urlsessiontask/priority.md)
- [URL session task priority](foundation/url-session-task-priority.md)
