Skip to content

Latest commit

 

History

History
29 lines (18 loc) · 759 Bytes

File metadata and controls

29 lines (18 loc) · 759 Bytes

SimplyNetworking

A lightweight, reusable, Swift Networking library.

### SPM Compatible.

Usage:

let apiClient = SNClient() // Basic Client
let request = try APIRequest(root: "https://theiosdude.api.com", path: "test", method: "GET").urlRequest() // URLRequest
request.addingQueryItem(name: "query", value: "Great Names") //https://theiosdude.api.com/test?query=great%20names
apiClient.request(request) { (result: Result<[PersonName], NetworkLoaderError> ) in
      switch result ...
    }
}

Stubbing

Responses can be stubbed, for unit tests using the URLProtocol subclass provided (MockSNClient). View the SimplyNetworkingTests XCTestCase class for an example

By Lee Burrows @TheiOSDude