Breaking
- Update to Swift 2.2. This release is not backwards compatible with Swift 2.1.
NetworkActivityPlugin
now accepts UIApplication
in it's initializer to be able to compile in application extensions environments.
NetworkActivityPlugin
supports only single instance of TRON
. If you have multiple TRON
s in your application, consider building another plugin, that uses static variables to track number of requests, similar to old NetworkActivityPlugin
from 5639b960e968586d1e24a7adcc6a3420e8648d49
.
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
and MultipartAPIRequest
, 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)")
}