Releases: MLSDev/TRON
1.0.0
Changes
None.
If you haven't been following beta releases, please read [1.0.0 Migration Guide](/Docs/1.0 Migration Guide.md) to get an overview of new API additions and phylosophy behind some breaking changes that were made in this release.
1.0.0-beta.3
Breaking changes
ResponseParseableprotocol reworked to only include single initializer instead of associated typeModelType. Therefore, all generic methods that previously acceptedModel.ModelTypetype now acceptModeltype.- Removed
performWithSuccess(_:failure:)method, please useperform(success:failure:)method instead.
Added
- Ability to create APIRequest with Array generic constraint, for example -
APIRequest<[Int],TronError>
Changed
ResponseParseableinitWithData:method is now throwable, allowing parsed models to throw during initialization. When initializer throws,APIRequesttreats it as a parsing error.
1.0.0-beta.2
Breaking changes
ResponseParseableprotocol now accepts NSData instead ofAnyObjectin its constructor, allowing any kind of parsing, JSON/XML, you-name-it.
1.0.0-beta.1
TRON 1.0 is a major release with a lot of new features and breaking changes. To find out more about philosophy of those and how to adapt to new API's, read [TRON 1.0 Migration Guide](/Docs/1.0 Migration Guide.md).
Breaking changes
RequestTokenprotocol removed, perform request methods now returnAlamofire.Request?to allow customization. When request is stubbed, nil is returned.tron.multipartRequest(path:)removed, usetron.uploadMultipart(path:formData:)method insteadMultipartAPIRequestperformWithSuccess(_:failure:progress:cancellableCallback:)method is replaced byperformMultipart(success:failure:encodingMemoryThreshold:encodingCompletion:)MultipartAPIRequestno longer subclassesAPIRequest- they both now subclassBaseRequest.appendMultipartData(_:name:filename:mimeType:)onMultipartAPIRequestis removed. Please useAlamofire.Manager.MultipartFormDatabuilt-in methods to append multipart data- RxSwift extension on
MultipartAPIRequestreworked to return single Observable EventDispatcherclass and correspondingTRON.dispatcher,APIRequest.dispatcherproperty are replaced byTRONandAPIRequestproperties -processingQueueandresultDeliveryQueue, which are used to determine on which queue should processing be performed and on which queue results should be delivered.ProgressandProgressClosuretypealiases have been removed
Added
upload(path:file:)- upload from fileupload(path:data:)- upload dataupload(path:stream:)- upload from streamdownload(path:destination:)- download file to destinationdownload(path:destination:resumingFromData:)- download file to destination, resuming from datauploadMultipart(path:formData:)- multipart form data uploadperform(completion:)method, that acceptsAlamofire.Response-> Void block.
Deprecations
APIRequestperformWithSuccess(_:failure:)method is deprecated, new name -perform(success:failure:)
0.4.3
Fixed
- Allow
MultipartAPIRequestto use any StringLiteralConvertible value in parameters (for example Int, or Bool e.t.c).
0.4.2
Fixed
- Prevent
APIRequestfrom being deallocated if rxResult Observable is passed elsewhere without keeping strong reference toAPIRequestitself.
0.4.1
Fixed
- Plugins are now correctly notified with "willSendRequest(_:)" method call for multipart requests.
0.4.0
Breaking
- Update to Swift 2.2. This release is not backwards compatible with Swift 2.1.
NetworkActivityPluginnow acceptsUIApplicationin it's initializer to be able to compile in application extensions environments.NetworkActivityPluginsupports only single instance ofTRON. If you have multipleTRONs in your application, consider building another plugin, that uses static variables to track number of requests, similar to oldNetworkActivityPluginfrom5639b960e968586d1e24a7adcc6a3420e8648d49.
Added
- Added
EmptyResponseclass that can be used for requests with empty body. For example:
let request : APIRequest<EmptyResponse, MyError> = tron.request("empty/response")- RxSwift extensions for
APIRequestandMultipartAPIRequest, usage:
let request : APIRequest<Foo, MyError> = tron.request("foo")
_ = request.rxResult.subscribeNext { result in
print(result)
}let multipartRequest : MultipartAPIRequest<Foo,MyError> = tron.multipartRequest("foo")
let (progress, result) = multipartRequest.rxUpload()
_ = progress.subscribeNext { progress in
print(progress.bytesSent,progress.totalBytesWritten,progress.totalBytesExpectedToWrite)
}
_ = result.subscribeNext { result in
print("Received result: \(result)")
}0.3.0
Completion blocks are now handled by new EventDispatcher class, which is responsible for running completion blocks on predefined GCD-queue.
Default behaviour - all parsing is made on QOS_CLASS_USER_INITIATED queue, success and failure blocks are called on main queue.
You can specify processingQueue, successDeliveryQueue and failureDeliveryQueue on dispatcher property of TRON. After request creation you can modify queues using dispatcher property on APIRequest, or even replace EventDispatcher with a custom one.
0.2.1
- Added public initializer for NetworkActivityPlugin