/LSAPI

Alamofire+Combine or Alamofire+RxSwift

Primary LanguageSwift

LSAPI

Carthage compatible Language

LSAPI is a basic library which is convenient to build network request observer, based on Rxswift or Combine.

Carthage

To integrate LSAPI into your Xcode project using Carthage, specify it in your Cartfile:

github "sandsn123/LSAPI"

NOTE: Please ensure that you have the latest Carthage installed.

📖 Usage

👀 See also:

Introduce

  • LSAPI: Basic interface service protocol library
  • AlamofireExecutor: On the basis of LSAPI, it uses alamofire to build the executor instance of request, You can customize other executor.
  • RxService: Rxswift + Alamofire
	GetBookService().asObservable()       
		.subscribe(onNext: { result in
            switch result {    
            case .success(let data):
                print(data)
            case .failure(let error):
                print(error)
            }
        })
        .disposed(by: self.disposeBag)
  • CbService: Combine + Alamofire
	self.cancellable = GetBookService().asPublisher()
          .sink(receiveCompletion: { (completion) in 
                  
            }) { (result) in
               print(result)
           }
        //.store(in: &self.cancellableSet)
                
        // Cancel the activity
        self.cancellable?.cancel()