Skip to content

Releases: 3lvis/Networking

Networking — 4.1.0

02 Oct 17:34
Compare
Choose a tag to compare

Added a way to extract the data from the response of a GET, POST, PUT, DELETE request. Before you would be able to access the JSON as dictionary or array, now you can also access the data. This is useful for example if you want to use Networking with JSONDecoder.

let networking = Networking(baseURL: "http://httpbin.org")
networking.get("/get") { result in 
   switch result { 
   case let .success(response): 
       // response.dictionaryBody -> JSON 
       // response.data -> JSON data
   case .failure: 
       // Handle error
   } 
} 

In order to achieve this in a clean way I had to modify the JSON enum, while doing this I noticed that the JSON enum was public, it wasn't meant to be public so I've converted it into a protected enum. The biggest breaking change of doing this is that some projects might be making use of the JSON.from(:bundle:) method, now you can access this utility using FileManager.json(from:bundle:).

Networking — 4.0.0

27 Sep 19:38
Compare
Choose a tag to compare

Xcode 9 and Swift 4 support!

Breaking changes

  • Renamed disableErrorLogging to isErrorLoggingEnabled
  • Changed initializer to use URLSessionConfiguration instead of the custom ConfigurationType.

Before

let networking = Networking(baseURL: "http://httpbin.org", configurationType: .default)

After

var configuration = URLSessionConfiguration.default
configuration.timeoutIntervalForRequest = TimeInterval(60)
configuration.timeoutIntervalForResource = TimeInterval(6048000)
let networking = Networking(baseURL: "http://httpbin.org", configuration: configuration)

Networking — 3.0.3

28 Mar 20:00
Compare
Choose a tag to compare
  • Update to Swift 3.1 (Xcode 8.3)

Networking — 3.0.2

06 Feb 12:35
Compare
Choose a tag to compare
  • Added convenience accessor for the result's error #197

Useful for when you don't care about the result but more if there's an error or not.

Before:

networking.delete("/user/10") { result in
    switch result {
    case .success:
        completion(nil)
    case .failure(let response):
        completion(response.error)
    }
}

Now:

networking.delete("/user/10") { result in
    completion(result.error) // NSError?
}

Networking — 3.0.1

03 Feb 06:46
Compare
Choose a tag to compare
  • Fix result crashing when the request was successful but the image or data were malformed. #196

Networking — 3.0.0

01 Feb 11:29
Compare
Choose a tag to compare

After 3 months of 2.0.0 we have refined Networking, refactored the internals, improved the unit tests and now we're ready to delete all the deprecated methods and make the big jump to 3.0.0.

Here are the things that you need to change in order to use Networking 3.

Networking — 3.0.0 (Beta 3)

31 Jan 23:10
Compare
Choose a tag to compare
Pre-release
  • Refactored internals, cleaned up a few methods

Networking — 3.0.0 (Beta 2)

30 Jan 13:50
Compare
Choose a tag to compare
Pre-release

Changes from Beta 1

Merged the error and the HTTPURLResponse into one object for each Result case.

Previously

After 3 months of 2.0.0 we have refined Networking, refactored the internals, improved the unit tests and now we're ready to delete all the deprecated methods and make the big jump to 3.0.0.

Here are the things that you need to change in order to use Networking 3.

Networking — 3.0.0 (Beta 1)

29 Jan 21:40
Compare
Choose a tag to compare
Pre-release

After 3 months of 2.0.0 we have refined Networking, refactored the internals, improved the unit tests and now we're ready to delete all the deprecated methods and make the big jump to 3.0.0.

Here are the things that you need to change in order to use Networking 3.

Networking — 2.8.0

29 Jan 06:14
Compare
Choose a tag to compare
  • Moved all methods to use lowercase instead of uppercase to follow Swift 3 guidelines
// Before
networking.GET(....)
networking.POST(....)
networking.PUT(....)
networking.DELETE(....)

// After
networking.get(....)
networking.post(....)
networking.put(....)
networking.delete(....)
  • Documented disabling error logging
let networking = Networking(baseURL: "http://httpbin.org")
networking.disableErrorLogging = true
  • Add support for synchronous networking
let networking = Networking(baseURL: "http://httpbin.org")
networking.isSynchronous = true