From 8300657317a62341f396951509bd6ba508acdac9 Mon Sep 17 00:00:00 2001 From: Max Desiatov Date: Sun, 7 Apr 2019 20:27:18 +0100 Subject: [PATCH] Bump version to 0.4.0, add CHANGELOG.md --- ApolloAlamofire.podspec | 4 ++-- CHANGELOG.md | 35 ++++++++++++++++++++++++++++++++ README.md | 44 +++++++++++++++++++++++------------------ 3 files changed, 62 insertions(+), 21 deletions(-) create mode 100644 CHANGELOG.md diff --git a/ApolloAlamofire.podspec b/ApolloAlamofire.podspec index 2c8ecff..5da6382 100644 --- a/ApolloAlamofire.podspec +++ b/ApolloAlamofire.podspec @@ -8,7 +8,7 @@ Pod::Spec.new do |s| s.name = 'ApolloAlamofire' - s.version = '0.3.0' + s.version = '0.4.0' s.summary = 'Alamofire transport for Apollo iOS GraphQL library' # This description is used to generate tags and improve search results. @@ -17,7 +17,7 @@ Pod::Spec.new do |s| # * Write the description between the DESC delimiters below. # * Finally, don't worry about the indent, CocoaPods strips it! - s.swift_version = '4.1' + s.swift_version = '4.2' s.description = <<-DESC This package bundles a `NetworkTransport` implementation that wraps Alamofire and solves known limitations of Apollo iOS library. diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..1244034 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,35 @@ +# Change Log + +## [0.4.0](https://github.com/graphql-community/ApolloAlamofire/tree/0.3.0) (2019-04-07) + +This update fixes compatibility with Xcode 10.2 and Swift 5.0. This release +also supports Swift 4.2 and Xcode 10.0 and 10.1, but unfortunately maintaining +a suite of tests and Xcode project settings that support Swift 4.0 and Xcode 9 +as well does not seem feasible (PRs that fix this are welcome!). + +No other changes were made and ApolloAlamofire 0.3.0 is recommended if you need +Xcode 9 support. + +**Closed issues:** + +- Xcode 10.2 & Swift 5.0 compatibility [\#2](https://github.com/graphql-community/ApolloAlamofire/issues/2) +- Error in compilation [\#1](https://github.com/graphql-community/ApolloAlamofire/issues/1) + +**Merged pull requests:** + +- Add and apply SwiftFormat [\#4](https://github.com/graphql-community/ApolloAlamofire/pull/4) ([MaxDesiatov](https://github.com/MaxDesiatov)) +- Add Xcode 10.2 to .travis.yml [\#3](https://github.com/graphql-community/ApolloAlamofire/pull/3) ([MaxDesiatov](https://github.com/MaxDesiatov)) + +## [0.3.0](https://github.com/graphql-community/ApolloAlamofire/tree/0.3.0) (2018-09-13) + +- Updated project for Swift 4.2 and Apollo 0.9. + +## [0.2.1](https://github.com/graphql-community/ApolloAlamofire/tree/0.2.1) (2018-05-03) + +- Added documentation for headers and logging properties. +- Improved README.md, added simple example code. + +## [0.2.0](https://github.com/graphql-community/ApolloAlamofire/tree/0.2.0) (2018-05-03) + +- Public props in AlamofireTransport +- Added simple test, updated example dependencies diff --git a/README.md b/README.md index 66f0230..66624bb 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # ApolloAlamofire -### Alamofire transport implementation for Apollo GraphQL iOS library. +### Alamofire transport implementation for Apollo GraphQL iOS library. [![CI Status](https://img.shields.io/travis/graphql-community/ApolloAlamofire/master.svg?style=flat)](https://travis-ci.org/MaxDesiatov/ApolloAlamofire) [![Version](https://img.shields.io/cocoapods/v/ApolloAlamofire.svg?style=flat)](https://cocoapods.org/pods/ApolloAlamofire) @@ -9,18 +9,18 @@ ## What's This For? -If you've used [Apollo iOS](https://github.com/apollographql/apollo-ios) library, +If you used [Apollo iOS](https://github.com/apollographql/apollo-ios) library, you may have stumbled upon a few limitations of a standard `HTTPNetworkTransport` provided with the library: -* [Can't swap request headers without creating a new `ApolloClient` instance](https://github.com/apollographql/apollo-ios/issues/37) -* [Can't send requests when the app is in background](https://stackoverflow.com/questions/50089546/how-to-correctly-use-apollo-graphql-on-ios-with-background-session-configuration) -* [Can't log request/response data](https://github.com/apollographql/apollo-ios/pull/257) +- [Can't swap request headers without creating a new `ApolloClient` instance](https://github.com/apollographql/apollo-ios/issues/37) +- [Can't send requests when the app is in background](https://stackoverflow.com/questions/50089546/how-to-correctly-use-apollo-graphql-on-ios-with-background-session-configuration) +- [Can't log request/response data](https://github.com/apollographql/apollo-ios/pull/257) -Fortunately, Apollo iOS provides a public `NetworkTransport` protocol that allows +Fortunately, Apollo iOS provides a public `NetworkTransport` protocol that allows us to override behaviour that's limited. Looks like [Alamofire](https://github.com/Alamofire/Alamofire) -is the most popular iOS networking library and all of the mentioned limitations can be solved -with it. You also probably use Alamofire anyway to acquire authentication tokens for your +is the most popular iOS networking library and all of the mentioned limitations can be solved +with it. You also probably use Alamofire anyway to acquire authentication tokens for your GraphQL API, so it makes sense to integrate both Alamofire and Apollo iOS. This package bundles a `NetworkTransport` implementation that wraps Alamofire @@ -29,11 +29,14 @@ and solves these limitations. ## Example When initialising a new `ApolloClient` instance instead of + ```swift let u = URL(string: "http://localhost:8080/graphql")! let client = ApolloClient(url: u) ``` + or instead of + ```swift let u = URL(string: "http://localhost:8080/graphql")! let client = ApolloClient(networkTransport: HTTPNetworkTransport(url: u)) @@ -49,7 +52,7 @@ let u = URL(string: "http://localhost:8080/graphql")! let client = ApolloClient(networkTransport: AlamofireTransport(url: u)) ``` -There are additional parameters available for `AlamofireTransport` initialiser, e.g. for +There are additional parameters available for `AlamofireTransport` initialiser, e.g. for a background session you can use it like this: ```swift @@ -62,7 +65,6 @@ let client = ApolloClient(networkTransport: t) like this for auth headers: - ```swift let token = "blah" let u = URL(string: "http://localhost:8080/graphql")! @@ -81,11 +83,11 @@ let client = ApolloClient(networkTransport: t) Both `headers` and `loggingEnabled` are also variable properties of `AlamofireTransport`. This allows you to change headers without instantiating a new transport, e.g. when a user -logs out and a different user logs in you can swap authentication headers. If you switch -logging dynamically, `loggingEnabled` property can be controlled in the same way +logs out and a different user logs in you can swap authentication headers. If you switch +logging dynamically, `loggingEnabled` property can be controlled in the same way without creating a new `AlamofireTransport` instance. -Nice feature of Alamofire is that request logging prints a ready for use +Nice feature of Alamofire is that request logging prints a ready for use [curl command](https://github.com/Alamofire/Alamofire/blob/master/Documentation/Usage.md#curl-command-output), which you can directly copy and paste in terminal to test a request. All of the initialiser parameters except `url` have sensible default values and can be used @@ -95,12 +97,16 @@ To run the example project, clone the repo, and open `Example/ApolloAlamofire.xc ## Requirements -* Xcode 10.0 or later -* Swift 4.2 or later +- Xcode 10.0 or later +- Swift 4.2 or later +- iOS 9.0 deployment target or later. + +If you integrate the library with CocoaPods, Alamofire and Apollo iOS +dependencies are pulled automatically. Currently tested compatible versions are +Alamofire 4.x and Apollo iOS 0.10.x. -If you integrate the library with CocoaPods, Alamofire and Apollo iOS dependencies are -pulled automatically. Currently tested versions that should be compatible are Alamofire 4.x -and Apollo iOS 0.10.x. +If you need Xcode 9 and Swift 4.0 support in your project you can use earlier +version of ApolloAlamofire: [0.3.0](https://github.com/graphql-community/ApolloAlamofire/tree/0.3.0). ## Installation @@ -108,7 +114,7 @@ ApolloAlamofire is available through [CocoaPods](https://cocoapods.org). To inst it, simply add the following line to your target configuration in your Podfile: ```ruby -pod 'ApolloAlamofire' +pod 'ApolloAlamofire', '~> 0.4.0' ``` ## Maintainer