From 28cf869b5a00f15adf23566a0098a49105e29fc7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carsten=20K=C3=B6nemann?= Date: Sat, 29 Oct 2016 15:44:52 +0200 Subject: [PATCH] Adopt new Swift naming scheme some more --- MarvelKit/MarvelKit/Extensions/NSURL+Parameters.swift | 10 +++++----- MarvelKit/MarvelKit/Request/Request.swift | 8 ++++---- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/MarvelKit/MarvelKit/Extensions/NSURL+Parameters.swift b/MarvelKit/MarvelKit/Extensions/NSURL+Parameters.swift index b243543..29d8e3d 100644 --- a/MarvelKit/MarvelKit/Extensions/NSURL+Parameters.swift +++ b/MarvelKit/MarvelKit/Extensions/NSURL+Parameters.swift @@ -12,7 +12,7 @@ public typealias URLParameters = [String: String] public extension URLComponents { - public func byAppendingQueryItems(_ queryItems: [URLQueryItem]) -> URLComponents { + public func appendingQueryItems(_ queryItems: [URLQueryItem]) -> URLComponents { var copy = self @@ -23,16 +23,16 @@ public extension URLComponents { return copy } - public func byAppendParameters(_ parameters: URLParameters) -> URLComponents { - return byAppendingQueryItems(parameters.flatMap { key, value in URLQueryItem(name: key, value: value) }) + public func appendingParameters(_ parameters: URLParameters) -> URLComponents { + return appendingQueryItems(parameters.flatMap { key, value in URLQueryItem(name: key, value: value) }) } } public extension URL { - public func byAppendingParameters(_ parameters: URLParameters) -> URL? { - return URLComponents(string: absoluteString)?.byAppendParameters(parameters).url + public func appendingParameters(_ parameters: URLParameters) -> URL? { + return URLComponents(string: absoluteString)?.appendingParameters(parameters).url } } diff --git a/MarvelKit/MarvelKit/Request/Request.swift b/MarvelKit/MarvelKit/Request/Request.swift index 60c3a1d..0e98f51 100644 --- a/MarvelKit/MarvelKit/Request/Request.swift +++ b/MarvelKit/MarvelKit/Request/Request.swift @@ -19,21 +19,21 @@ open class Request { // MARK: Internal initializers init(resource: Resource.Type, authentication: Authentication) { - url = resource.absoluteURL()?.byAppendingParameters(authentication.params()) + url = resource.absoluteURL()?.appendingParameters(authentication.params()) } init(resource: Resource.Type, authentication: Authentication, id: Int) { - url = resource.absoluteURL(id: id)?.byAppendingParameters(authentication.params()) + url = resource.absoluteURL(id: id)?.appendingParameters(authentication.params()) } init(resource: Resource.Type, authentication: Authentication, filter: ResourceFilter) { - url = resource.absoluteURL(filter: filter)?.byAppendingParameters(authentication.params()) + url = resource.absoluteURL(filter: filter)?.appendingParameters(authentication.params()) } // MARK: Public builders open func withParameters(_ parameters: [Resource.ResourceParameterType]) -> Request { - url = url?.byAppendingParameters(parameters.urlParameters) + url = url?.appendingParameters(parameters.urlParameters) return self }