Releases: MLSDev/TRON
2.0.1
Lowers deployment targets to iOS 8 / macOS 10.10
Required dependencies: Alamofire 4.1 and higher.
2.0.0
NetworkLoggerPlugin
now haslogCancelledRequests
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
APIStub
creation is deferred untilapiStub
property is called.APIStub
model
anderror
properties have been replaced withmodelClosure
anderrorClosure
, that are created inAPIStub
constructor. This is done to allowAPIStub
to function even ifAPIRequest
has been deallocated.
2.0.0-beta.4
- Plugin protocol was rewritten to contain generic methods and more information about what is happening in TRON ecosystem.
ErrorHandlingDataResponseSerializerProtocol
andErrorHandlingDownloadResponseSerializerProtocol
now have protocol extensions for default SwiftyJSON error parsing.
2.0.0-beta.3
Parseable
protocol was rewritten to directly inherit fromAlamofire.DataResponseSerializerProtocol
. It allows us to have two generic typealiases -SerializedObject
fromAlamofire
and added to itSerializedError
from TRON.- Fixed issue, that could cause completion handlers to be called on background thread.
- Use SwiftyJSON instead of forked SwiftyJSON3
parameters
property onBaseRequest
now contains [String:Any] instead of [String:AnyObject]processingQueue
property onAPIRequest
was removed.
2.0.0-beta.2
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 obligatoryresponseParser
anderrorParser
properties, that define, how response and errors are parsed. APIStub
objects are now usingresponseParser
anderrorParser
of the request, and therefore have been entirely rewritten with new properties, that acceptData
objects instead of directly setting result.JSONDecodable
protocol now provides convenience methods to use withTRON
andAPIRequest
, that work the same as before, therefore almost maintaining backwards code compatibility forTRON/SwiftyJSON
subspec.ErrorBuilder
class was removed.
2.0.0-beta.1
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 toParseable
. 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 largerUploadAPIRequest
class.- Introduced new
DownloadAPIRequest
class, that receives part ofAPIRequest
functionality.
Renamings
- Swift 3 API design guidelines have been applied to all API.
perform(completion:)
method was renamed toperformCollectingTimeline(withCompletion:)
to better match method internal behaviourencoding
property onTRON
and requests has been renamed toparameterEncoding
and now has a different type -Alamofire.ParameterEncoding
Removals
responseBuilder
property onAPIRequest
was removed, as it's no longer used when parsing received response.JSONDecodable
extension onArray
is temporarily unavailable due to issues with Swift compiler.encodingStrategy
property on TRON was removed - please useparameterEncoding
instead.TRON.RESTencodingStrategy
andTRON.URLEncodingStrategy
were removed - please refer to Alamofire 4 migration guide for details.RequestType
enum was replaced byUploadRequestType
andDownloadRequestType
onDownloadAPIRequest
andUploadAPIRequest
classes.
1.2.0
Changed
Support for building with Swift 2.3 along with Swift 2.2.
1.1.1
Added
- Optional
progressClosure
parameter torxMultipartUpload
method for multipart requests
1.1.0
Added
stubbingShouldBeSuccessful
property onTRON
, that allows setting up globally, will stubs succeed or not.encodingStrategy
property onTRON
instance, that is used to select encoding type based on HTTP Method.encodingStrategy
property onAPIRequest
, that will be filled withTRON
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 onAPIRequest
. Please useencodingStrategy
property instead.