I have a view controller and a custom class to call APIs. One API doesn't return anything if it succeeds. I get empty response.
class APIManager {
static func callAPI(completion: @escaping ((Result</*Empty*/, Error>))) {
completion(.failure(Error()))
if statusCode == 200 {
completion(.success(/*Pass nothing*/))
}
}
}
I know I can use String type and pass String literal. Is there any better way?