Skip to content

Commit

Permalink
[swift6] general improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
4brunu committed Oct 1, 2024
1 parent 04636ac commit 152e1ce
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
// Override point for customization after application launch.

// Customize requestBuilderFactory
PetstoreClientAPI.shared.requestBuilderFactory = BearerRequestBuilderFactory()
OpenAPIClient.shared.requestBuilderFactory = BearerRequestBuilderFactory()

return true
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
// Override point for customization after application launch.

// Customize requestBuilderFactory
PetstoreClientAPI.shared.requestBuilderFactory = BearerRequestBuilderFactory()
OpenAPIClient.shared.requestBuilderFactory = BearerRequestBuilderFactory()

return true
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class BearerRequestBuilderFactory: RequestBuilderFactory {
class BearerRequestBuilder<T>: URLSessionRequestBuilder<T>, @unchecked Sendable {

@discardableResult
override func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.shared.apiResponseQueue, _ completion: @Sendable @escaping (Result<Response<T>, ErrorResponse>) -> Void) -> RequestTask {
override func execute(_ apiResponseQueue: DispatchQueue = OpenAPIClient.shared.apiResponseQueue, _ completion: @Sendable @escaping (Result<Response<T>, ErrorResponse>) -> Void) -> RequestTask {

guard self.requiresAuthentication else {
return super.execute(apiResponseQueue, completion)
Expand Down Expand Up @@ -79,7 +79,7 @@ class BearerRequestBuilder<T>: URLSessionRequestBuilder<T>, @unchecked Sendable
class BearerDecodableRequestBuilder<T: Decodable>: URLSessionDecodableRequestBuilder<T>, @unchecked Sendable {

@discardableResult
override func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.shared.apiResponseQueue, _ completion: @Sendable @escaping (Result<Response<T>, ErrorResponse>) -> Void) -> RequestTask {
override func execute(_ apiResponseQueue: DispatchQueue = OpenAPIClient.shared.apiResponseQueue, _ completion: @Sendable @escaping (Result<Response<T>, ErrorResponse>) -> Void) -> RequestTask {

guard self.requiresAuthentication else {
return super.execute(apiResponseQueue, completion)
Expand Down

0 comments on commit 152e1ce

Please sign in to comment.