Change Log
9.0.0
- This release replaces the custom
Result
type with the one provided by the Swift 5 Standard Library. This is a breaking change, since you now have to explicitly specify theError
type. In addition, theerror
convenience method has also been renamed tofailureResult
to match thesuccessResult
method.
8.2.0
- This release adds support for Swift 5.0
8.1.0
- Includes support to override character set for encoding URL query parameters.
8.0.1
- Adds
swift_version
to the podspec as it is now enforced by Cocoapods 1.6.0.
8.0.0
- Adds Swift 4.2 support
7.2.2
- Adds optional
requestTimeoutInterval
property toNetworkResourceType
which can be used to set aURLRequest
specific timeout for the resource.
7.2.1
- Fixes an issue where
super.start()
was being called unnecessarily.
7.2.0
- Adds the ability to cancel all requests from the resource service.
7.1.0
- Adds the ability to cancel all requests from the URLSessionType.
7.0.1
- Removed superfluous SwiftLint disablement.
7.0.0
- Handle failure to parse model in a dedicated failure case. If the response is successful, but an error is thrown during parsing, then a
NetworkServiceError.parsingModel
failure case is passed along to the completion.
6.1.0
- Added Codable support (
JSONDecodableResourceType
, et al)
6.0.0
- Migrated to Swift 4
5.0.1
- Moved internal
Result
to test target
5.0.0
- The error from a failed
NetworkResponse
is now flattened and moved into theNetworkServiceError
couldNotParseModel
case to avoid nested switch statements:
enum NetworkResponse<Model> {
case success(Model, HTTPURLResponse)
case failure(NetworkServiceError, HTTPURLResponse?)
}
4.0.0
-
DataResourceType
transformation function now throws on failure instead of returningResult<Model>
:// Old interface func result(from data: Data) -> Result<Model> // New interface func model(from data: Data) throws -> Model
-
JSONDictionaryResourceType
transformation function now throws on failure instead of returningModel?
:// Old interface func model(from jsonDictionary: [String : Any]) -> Model? // New interface func model(from jsonDictionary: [String : Any]) throws -> Model
-
JSONArrayResourceType
transformation function now throws on failure instead of returningModel?
:// Old interface func model(from jsonArray: [Any]) -> Model? // New interface func model(from jsonArray: [Any]) throws -> Model
-
Refactored network service
- Renamed
NetworkDataResourceService
toGenericNetworkDataResourceService
, this is useful when using it withResourceOperation
- New
NetworkDataResourceService
uses a generic fetching function NetworkDataResourceService
now usesNetworkResponse
as the result type in the completion handler
- Renamed
3.2.0
- Issue #21 - Added support for cancelling request
NetworkDataResourceService
now returns aCancellable
type
3.1.1
- Removed unnecessary
ResourceOperationType
protocol NetworkDataResourceService
now invalidates it's session on deinit
3.1.0
- Added support for listen to network activity changes, useful for setting up
isNetworkActivityIndicatorVisible
onUIApplication
fetch(resource: Resource, completion: @escaping (Result<Resource.Model>) -> Void)
method onNetworkDataResourceService
is nowopen
for overriding
3.0.3
- Added documentation on
BaseAsynchronousOperation
- Removed errors parameter from
finish()
inBaseAsynchronousOperation
3.0.2
URLSession
used byNetworkDataResourceService
is now exposed in the initializer
3.0.1
resource
,service
anddidFinishFetchingResourceCallback
properties inResourceOperation
are nowinternal
to allow for unit testing purposes
3.0.0
- Removed deprecated
JSONResourceType
andNetworkJSONResourceType
- Issue #9 - Improvements to meet Swift API guidelines
2.1.0
Bug fixes
- Issue #3 - Query items on the
URL
for aNetworkResourceType
are now added to the generatedURLRequest
New features
- Issue #4 - Introduced
JSONArrayResourceType
andJSONDictionaryResourceType
in favour of now deprecatedJSONResourceType
- Issue #7 -
HTTPMethod
now uses lower case enums, e.g.get
instead ofGET
2.0.0
- Migrated to Swift 3
1.0.0
- Initial release
- Retrieve JSON or image resources using a network service
- Included a resource operation to manage concurrency