Skip to content

Releases: MLSDev/TRON

2.0.1

30 Nov 13:56
Compare
Choose a tag to compare

Lowers deployment targets to iOS 8 / macOS 10.10

Required dependencies: Alamofire 4.1 and higher.

2.0.0

31 Oct 15:09
Compare
Choose a tag to compare
  • NetworkLoggerPlugin now has logCancelledRequests property, that allows turning off logging of failing requests, that were explicitly cancelled by developer.
  • Ensures, that APIStub always calls completion blocks, even if response is not successfully created.

2.0.0-beta.5

31 Oct 15:08
Compare
Choose a tag to compare
2.0.0-beta.5 Pre-release
Pre-release
  • APIStub creation is deferred until apiStub property is called.
  • APIStub model and error properties have been replaced with modelClosure and errorClosure, that are created in APIStub constructor. This is done to allow APIStub to function even if APIRequest has been deallocated.

2.0.0-beta.4

31 Oct 15:08
Compare
Choose a tag to compare
2.0.0-beta.4 Pre-release
Pre-release
  • Plugin protocol was rewritten to contain generic methods and more information about what is happening in TRON ecosystem.
  • ErrorHandlingDataResponseSerializerProtocol and ErrorHandlingDownloadResponseSerializerProtocol now have protocol extensions for default SwiftyJSON error parsing.

2.0.0-beta.3

24 Sep 15:05
Compare
Choose a tag to compare
2.0.0-beta.3 Pre-release
Pre-release
  • Parseable protocol was rewritten to directly inherit from Alamofire.DataResponseSerializerProtocol. It allows us to have two generic typealiases - SerializedObject from Alamofire and added to it SerializedError from TRON.
  • Fixed issue, that could cause completion handlers to be called on background thread.
  • Use SwiftyJSON instead of forked SwiftyJSON3
  • parameters property on BaseRequest now contains [String:Any] instead of [String:AnyObject]
  • processingQueue property on APIRequest was removed.

2.0.0-beta.2

21 Sep 08:58
Compare
Choose a tag to compare
2.0.0-beta.2 Pre-release
Pre-release

IMPORTANT Please check out meta-ticket, discussing response serialization changes in beta-2. Feedback is really important for next betas and final release.

  • Parseable protocol was rewritten from generic static func to having associatedtype and a func inside. This is done to broaden support for any kinds of mappers. Good example would be CoreData objects creation, that requires different contexts for background threads, and was difficult to implement using old syntax.
  • All TRON request methods now contain obligatory responseParser and errorParser properties, that define, how response and errors are parsed.
  • APIStub objects are now using responseParser and errorParser of the request, and therefore have been entirely rewritten with new properties, that accept Data objects instead of directly setting result.
  • JSONDecodable protocol now provides convenience methods to use with TRON and APIRequest, that work the same as before, therefore almost maintaining backwards code compatibility for TRON/SwiftyJSON subspec.
  • ErrorBuilder class was removed.

2.0.0-beta.1

17 Sep 11:41
Compare
Choose a tag to compare
2.0.0-beta.1 Pre-release
Pre-release

TRON 2.0 is supported on iOS 9.0, macOS 10.11 and higher due to Alamofire.framework required versions. Read [migration guide](/Docs/2.0 Migration Guide.md) for overview of API changes.

NOTE This release uses forked SwiftyJSON, and SwiftyJSON3 cocoapod, because original repo has not been updated to Swift 3. In future release we hope to use SwiftyJSON cocoapod. Comment on SwiftyJSON repo.

API changes

  • ResponseParseable was rewritten and renamed to Parseable. It now allows creating models without using a constructor. Therefore, it's now possibly to use really any kind of mapper and make factory-like response builders.
  • Success blocks on APIRequest are now optional and equal to nil by default.
  • MultipartAPIRequest now becomes a part of larger UploadAPIRequest class.
  • Introduced new DownloadAPIRequest class, that receives part of APIRequest functionality.

Renamings

  • Swift 3 API design guidelines have been applied to all API.
  • perform(completion:) method was renamed to performCollectingTimeline(withCompletion:) to better match method internal behaviour
  • encoding property on TRON and requests has been renamed to parameterEncoding and now has a different type - Alamofire.ParameterEncoding

Removals

  • responseBuilder property on APIRequest was removed, as it's no longer used when parsing received response.
  • JSONDecodable extension on Array is temporarily unavailable due to issues with Swift compiler.
  • encodingStrategy property on TRON was removed - please use parameterEncoding instead.
  • TRON.RESTencodingStrategy and TRON.URLEncodingStrategy were removed - please refer to Alamofire 4 migration guide for details.
  • RequestType enum was replaced by UploadRequestType and DownloadRequestType on DownloadAPIRequest and UploadAPIRequest classes.

1.2.0

10 Sep 11:29
Compare
Choose a tag to compare

Changed

Support for building with Swift 2.3 along with Swift 2.2.

1.1.1

01 Aug 16:25
Compare
Choose a tag to compare

Added

  • Optional progressClosure parameter to rxMultipartUpload method for multipart requests

1.1.0

07 Jul 18:29
Compare
Choose a tag to compare

Added

  • stubbingShouldBeSuccessful property on TRON, that allows setting up globally, will stubs succeed or not.
  • encodingStrategy property on TRON instance, that is used to select encoding type based on HTTP Method.
  • encodingStrategy property on APIRequest, that will be filled with TRON strategy on construction.

By default, for backwards compatibility reasons, we use ParameterEncoding.URL as a default strategy. This will change in next major release of TRON, which will use TRON.RESTEncodingStrategy instead. This encoding strategy uses .JSON encoding for POST, PUT and PATCH requests, and .URL encoding for all other HTTP methods.

Deprecated

  • encoding property on APIRequest. Please use encodingStrategy property instead.