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
ResponseParseable
protocol reworked to only include single initializer instead of associated typeModelType
. Therefore, all generic methods that previously acceptedModel.ModelType
type now acceptModel
type.- 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
ResponseParseable
initWithData:
method is now throwable, allowing parsed models to throw during initialization. When initializer throws,APIRequest
treats it as a parsing error.
1.0.0-beta.2
Breaking changes
ResponseParseable
protocol now accepts NSData instead ofAnyObject
in 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
RequestToken
protocol 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 insteadMultipartAPIRequest
performWithSuccess(_:failure:progress:cancellableCallback:)
method is replaced byperformMultipart(success:failure:encodingMemoryThreshold:encodingCompletion:)
MultipartAPIRequest
no longer subclassesAPIRequest
- they both now subclassBaseRequest
.appendMultipartData(_:name:filename:mimeType:)
onMultipartAPIRequest
is removed. Please useAlamofire.Manager.MultipartFormData
built-in methods to append multipart data- RxSwift extension on
MultipartAPIRequest
reworked to return single Observable EventDispatcher
class and correspondingTRON.dispatcher
,APIRequest.dispatcher
property are replaced byTRON
andAPIRequest
properties -processingQueue
andresultDeliveryQueue
, which are used to determine on which queue should processing be performed and on which queue results should be delivered.Progress
andProgressClosure
typealiases 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
APIRequest
performWithSuccess(_:failure:)
method is deprecated, new name -perform(success:failure:)
0.4.3
Fixed
- Allow
MultipartAPIRequest
to use any StringLiteralConvertible value in parameters (for example Int, or Bool e.t.c).
0.4.2
Fixed
- Prevent
APIRequest
from being deallocated if rxResult Observable is passed elsewhere without keeping strong reference toAPIRequest
itself.
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.
NetworkActivityPlugin
now acceptsUIApplication
in it's initializer to be able to compile in application extensions environments.NetworkActivityPlugin
supports only single instance ofTRON
. If you have multipleTRON
s in your application, consider building another plugin, that uses static variables to track number of requests, similar to oldNetworkActivityPlugin
from5639b960e968586d1e24a7adcc6a3420e8648d49
.
Added
- Added
EmptyResponse
class that can be used for requests with empty body. For example:
let request : APIRequest<EmptyResponse, MyError> = tron.request("empty/response")
- RxSwift extensions for
APIRequest
andMultipartAPIRequest
, 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