Page updated Nov 9, 2023

Delete data

Amplify iOS v1 is now in Maintenance Mode until May 31st, 2024. This means that we will continue to include updates to ensure compatibility with backend services and security. No new features will be introduced in v1.

Please use the latest version (v2) of Amplify Library for Swift to get started.

If you are currently using v1, follow these instructions to upgrade to v2.


func deleteTodo() { let request = RESTRequest(path: "/todo") Amplify.API.delete(request: request) { result in switch result { case .success(let data): let str = String(decoding: data, as: UTF8.self) print("Success \(str)") case .failure(let apiError): print("Failed", apiError) } } }
1func deleteTodo() {
2 let request = RESTRequest(path: "/todo")
3 Amplify.API.delete(request: request) { result in
4 switch result {
5 case .success(let data):
6 let str = String(decoding: data, as: UTF8.self)
7 print("Success \(str)")
8 case .failure(let apiError):
9 print("Failed", apiError)
10 }
11 }