Question: I used this code to cancel all `Alamofire` requests:

```
func stopAllSessions() {
    Alamofire.Manager.sharedInstance.session.getAllTasksWithCompletionHandler { tasks in
        tasks.forEach { $0.cancel() }
    }
}

```

After swift 3 migration, this doesn't work, and I can't find `getAllTasksWithCompletionHandler` method in `SessionManager` of `Alamofire` 4.

Answer: 
Found:

```
    Alamofire.SessionManager.default.session.getTasksWithCompletionHandler { (sessionDataTask, uploadData, downloadData) in
        sessionDataTask.forEach { $0.cancel() }
        uploadData.forEach { $0.cancel() }
        downloadData.forEach { $0.cancel() }
    }

```
The method you are searching for has changed to `getAllTasks(completionHandler:)`.

```
Alamofire.SessionManager.default.session.getAllTasks { task in
    task.forEach { $0.cancel() }
}

```