From dd71a253b90c32fe68b9186ac3a0b23ff3b43e47 Mon Sep 17 00:00:00 2001 From: tobias <thinkdifferent055@gmail.com> Date: Thu, 23 Dec 2021 13:03:16 +0100 Subject: [PATCH] Improve optional data types --- AppleLibs/Network/Requests/DataManager.swift | 5 +++-- AppleLibs/Network/Requests/DataMapper.swift | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/AppleLibs/Network/Requests/DataManager.swift b/AppleLibs/Network/Requests/DataManager.swift index f1eb9c0..739ab79 100644 --- a/AppleLibs/Network/Requests/DataManager.swift +++ b/AppleLibs/Network/Requests/DataManager.swift @@ -12,13 +12,14 @@ import Logging public protocol HttpResponseFilter { @available(iOS 15.0.0, *) - func handleResponse(request: Request, data: Data?, dataMapper: DataMapper?, sender: Any?) async throws -> Any + func handleResponse(request: Request, data: Data, dataMapper: DataMapper?, sender: Any?) async throws -> Any } public protocol HttpSuccessFilter { @available(iOS 15.0.0, *) - func handleResponse(data: Data?, response: HTTPURLResponse, dataMapper: DataMapper?, sender: Any?) async throws -> Any + + func handleResponse(data: Data, response: HTTPURLResponse, dataMapper: DataMapper?, sender: Any?) async throws -> Any } public protocol DataManagerDelegate diff --git a/AppleLibs/Network/Requests/DataMapper.swift b/AppleLibs/Network/Requests/DataMapper.swift index d40b684..ca13644 100644 --- a/AppleLibs/Network/Requests/DataMapper.swift +++ b/AppleLibs/Network/Requests/DataMapper.swift @@ -11,5 +11,5 @@ import Foundation public protocol DataMapper { @available(iOS 15.0.0, *) - func mapData(data: Data?, response: URLResponse?, sender: Any?) async throws -> Any + func mapData(data: Data, response: HTTPURLResponse, sender: Any?) async throws -> Any } -- GitLab