---
title: new()
framework: foundation
role: symbol
role_heading: Type Method
path: foundation/urlsessiontask/new()
---

# new()

Creates a new URL session task.

## Declaration

```swift
class func new() -> Self
```

## Return Value

Return Value Don’t call this method directly. Instead, create tasks from a URLSession.

## See Also

### Deprecated

- [init()](foundation/urlsessiontask/init().md)
