https://github.com/boldare/swift-api
https://github.com/boldare/swift-api
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/boldare/swift-api
- Owner: boldare
- License: mit
- Created: 2016-12-06T21:49:47.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2019-11-07T13:57:21.000Z (over 6 years ago)
- Last Synced: 2025-04-02T12:39:43.579Z (about 1 year ago)
- Language: Swift
- Size: 6.55 MB
- Stars: 12
- Watchers: 50
- Forks: 5
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# SwiftAPI
**Swift API** was born as idea of having very light, very fast, written in swift, easy to update and ready to use out of the box library for communication through network. Now that idea is real as cocoapod library. Main features of library:
- Written using Swift 4
- Ready to use out of the box
- Using URLSession for managing requests
- Allows sending requests in foreground or background
- Supports connection with REST and non-REST APIs
- Introduces easy to use wrapper for status codes
- Is available for iOS, macOS, watchOS and tvOS
- Supports Codable protocol
## Installation
Swift-API is available through [CocoaPods](http://cocoapods.org/pods/SwiftAPI). To install it, simply add the following line to your Podfile
```ruby
pod 'SwiftAPI'
```
and run
```ruby
pod install
```
## Usage
At the beginning, import library by adding
```swift
import SwiftAPI
```
then you can create instance of ApiService
```swift
let apiService = ApiService()
```
or RestService
```swift
let rootURL = URL(string:"https://API.SERVER.ADDRESS.COM")
let apiPath = "/v1.0"
let restService = RestService(baseUrl: rootURL, apiPath: apiPath)
```
and now you can start sending requests.
To get familiar with more advanced usage please take a look at usage example available with library.
## Authors
- Marek Kojder, marek.kojder@xsolve.pl
- Sławomir Zagórski, slawomir.zagorski@xsolve.pl
- Radosław Budzik, radoslaw.budzik@xsolve.pl
## License
SwiftAPI is available under the MIT license. See the LICENSE file for more info.