ReactiveAPI
Reactive API library allows you to write clean, concise and declarative network code, with the power of RxSwift and URLSession!
Reactive API library allows you to write clean, concise and declarative network code, with the power of RxSwift and URLSession!
I thought the best way to show the ReactiveAPI potential is to make a demo app with it from scratch, with the bare minimum to show something to the user. I used swapi.co open APIs and only ReactiveAPI as dependency. Updated Readme as well with some examples taken from the demo.
inject existing token when failed requests don't have a token or hav a token different from the current one. This reduces requests made to the backend. Updated HTTPStubs implementation.
Current TokenAuthenticationDemo token renew was broken when trying to do multiple symultaneous requests, which resulted in multiple token renew requests when each one of the original requests got 401 from server.
To solve this and to help library users write simple token-based authenticators, the new ReactiveAPITokenAuthenticator
has been introduced.
To ease debugging, an optional ReactiveAPITokenAuthenticatorLogger
can be provided.
It often happens to pass complex data types as query string (e.g. Date) and to have the need of doing custom string representation of the objects. This adds that possibility.
When declaring an API with the following signature
func myAPI() -> Single<[MyDataType]>
Xcode won't compile complaining about "ambiguous reference". This is because:
func request<D: Decodable>(_ method: ReactiveAPIHTTPMethod = .get,
url: URL,
headers: [String: Any?]? = nil,
queryParams: [String: Any?]? = nil,
bodyParams: [String: Any?]? = nil) -> Single<[D]>
conflicts with
func request<D: Decodable>(_ method: ReactiveAPIHTTPMethod = .get,
url: URL,
headers: [String: Any?]? = nil,
queryParams: [String: Any?]? = nil,
bodyParams: [String: Any?]? = nil) -> Single<D>
because[D]
is the same as D
when D: Decodable
Fixed by removing the redundant functions!
Yesterday Apple unveiled Combine, an Rx Like framework for iOS 13+ and macOS 10.15+.
https://developer.apple.com/documentation/combine/publisher
This is a game changer and can be a huge benefit for ReactiveAPI looking forward.
Up to this point if we set baseUrl = https://www.server.com/api
and we have an API which needs to call the baseURL, we need to write a func like this:
func getRoot() -> Single<Root> {
return request(url: absoluteURL(""))
}
absoluteURL("")
is really ugly, we should find a more elegant way
Upgrade RXSwift version
Source code(tar.gz)Removed FailableArrayCodable
Source code(tar.gz)upgrade to Xcode13
Source code(tar.gz)Improved token management
Source code(tar.gz)Another network wrapper for URLSession. Built to be simple, small and easy to create tests at the network layer of your application. Install Carthage
GitHub iOS client in RxSwift and MVVM-C clean architecture. FlutterHub - Flutter version available at an early stage KotlinHub - Android version is co
Reachability A new, clean and lean network interface reachability library written in Swift. Remarks Network reachability changes can be monitored usin
NetKit A Concise HTTP Framework in Swift. Requirements NetKit requires Swift 5.0 and Xcode 10.2 Installation CocoaPods You can use CocoaPods to integr
Easy and lightweight network layer for creating different set of network requests like GET, POST, PUT, DELETE customizable with coders conforming to TopLevelDecoder, TopLevelEncoder
URIBlockNE A network extension app to block a user input URI. Meant as a network extension filter proof of concept. This is just a research effort to
MHNetwork Protocol Oriented Network Layer Aim to avoid having bloated singleton NetworkManager Philosophy the main philosophy behind MHNetwork is to h
NWReachability is a pure Swift library for monitoring the network connection of iOS devices using Apple's Network framework.
Reactive wrapper for URLSession using Combine. At its core, the library consist of the NetworkServiceClient protocol along with a minimal implementation NetworkService.
⛅️ weatherApp-iOS-practice ?? 기능 상세 도시 이름을 입력하면 현재 날씨 정보를 가져와 화면에 표시되게 만들어야 합니다
GeminiProtocol Network.Framework and URLSession support for the Gemini Protocol
The elegant way to write iOS / macOS REST clients Drastically simplifies app code by providing a client-side cache of observable models for RESTful re
Squid Squid is a declarative and reactive networking library for Swift. Developed for Swift 5, it aims to make use of the latest language features. Th
Reusable system for complex URL requests with Swift. Deal with query items, HTTP headers, request body and more in an easy, declarative way. Check out our engineering blog to learn more!
RxRestClient Example To run the example project, clone the repo, and run pod install from the Example directory first. Requirements iOS 10.0+ tvOS 10.
RxTodo RxTodo is an iOS application developed using ReactorKit. This project is for whom having trouble with learning how to build a RxSwift applicati
RxRestClient Example To run the example project, clone the repo, and run pod install from the Example directory first. Requirements iOS 10.0+ tvOS 10.
Corvus Corvus is the first truly declarative server-side framework for Swift. It provides a declarative, composable syntax which makes it easy to get
A testable RxSwift wrapper around MultipeerConnectivity