Skip to content

Releases: MLSDev/TRON

1.0.0

21 May 13:22
Compare
Choose a tag to compare

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

19 May 14:59
Compare
Choose a tag to compare

Breaking changes

  • ResponseParseable protocol reworked to only include single initializer instead of associated type ModelType. Therefore, all generic methods that previously accepted Model.ModelType type now accept Model type.
  • Removed performWithSuccess(_:failure:) method, please use perform(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

19 May 14:58
Compare
Choose a tag to compare

Breaking changes

  • ResponseParseable protocol now accepts NSData instead of AnyObject in its constructor, allowing any kind of parsing, JSON/XML, you-name-it.

1.0.0-beta.1

15 May 11:23
Compare
Choose a tag to compare

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 return Alamofire.Request? to allow customization. When request is stubbed, nil is returned.
  • tron.multipartRequest(path:) removed, use tron.uploadMultipart(path:formData:) method instead
  • MultipartAPIRequest performWithSuccess(_:failure:progress:cancellableCallback:) method is replaced by performMultipart(success:failure:encodingMemoryThreshold:encodingCompletion:)
  • MultipartAPIRequest no longer subclasses APIRequest - they both now subclass BaseRequest.
  • appendMultipartData(_:name:filename:mimeType:) on MultipartAPIRequest is removed. Please use Alamofire.Manager.MultipartFormData built-in methods to append multipart data
  • RxSwift extension on MultipartAPIRequest reworked to return single Observable
  • EventDispatcher class and corresponding TRON.dispatcher, APIRequest.dispatcher property are replaced by TRON and APIRequest properties - processingQueue and resultDeliveryQueue, which are used to determine on which queue should processing be performed and on which queue results should be delivered.
  • Progress and ProgressClosure typealiases have been removed

Added

  • upload(path:file:) - upload from file
  • upload(path:data:) - upload data
  • upload(path:stream:) - upload from stream
  • download(path:destination:) - download file to destination
  • download(path:destination:resumingFromData:) - download file to destination, resuming from data
  • uploadMultipart(path:formData:) - multipart form data upload
  • perform(completion:) method, that accepts Alamofire.Response -> Void block.

Deprecations

  • APIRequest performWithSuccess(_:failure:) method is deprecated, new name - perform(success:failure:)

0.4.3

23 Apr 08:36
Compare
Choose a tag to compare

Fixed

  • Allow MultipartAPIRequest to use any StringLiteralConvertible value in parameters (for example Int, or Bool e.t.c).

0.4.2

22 Apr 15:19
Compare
Choose a tag to compare

Fixed

  • Prevent APIRequest from being deallocated if rxResult Observable is passed elsewhere without keeping strong reference to APIRequest itself.

0.4.1

21 Apr 12:55
Compare
Choose a tag to compare

Fixed

  • Plugins are now correctly notified with "willSendRequest(_:)" method call for multipart requests.

0.4.0

19 Apr 12:39
Compare
Choose a tag to compare

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 TRONs 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)")
}

0.3.0

15 Mar 13:24
Compare
Choose a tag to compare

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

11 Mar 10:53
Compare
Choose a tag to compare
  • Added public initializer for NetworkActivityPlugin