---
title: "init(taskList:tasks:all:)"
framework: intents
role: symbol
role_heading: Initializer
path: "intents/indeletetasksintent/init(tasklist:tasks:all:)"
---

# init(taskList:tasks:all:)

Creates the intent object with information about the task list and the tasks to delete from it.

## Declaration

```swift
@nonobjc convenience init(taskList: INTaskList? = nil, tasks: [INTask]? = nil, all: Bool? = nil)
```

## Parameters

- `taskList`: The task list from which to delete tasks.
- `tasks`: An array of tasks to delete.
- `all`: A Boolean value that indicates whether to delete all of the tasks in the task list.

## Return Value

Return Value An initialized intent object or nil if the object could not be created.

## Discussion

Discussion Typically, you don’t create instances of this class yourself. Instead, SiriKit creates instances when the user asks to set the attributes of a task. However, you can use this method during testing to create intent objects that validate your intent handling code paths.
