Skip to content

Latest commit

 

History

History
34 lines (25 loc) · 1.03 KB

README.md

File metadata and controls

34 lines (25 loc) · 1.03 KB

Trikot.http swift extensions

To use Trikot.http swift extensions, you must export http module in your exported framework. See Trikot.patron build.gradle file for a sample use case.

Setup Pod dependency
    ENV['TRIKOT_FRAMEWORK_NAME']='ReplaceMeByTheFrameworkNameImportedByCocoaPods'
  pod 'Trikot/http', :git => '[email protected]:mirego/trikot.git', :tag => properties['trikot_version']

Then, run pod install.

Setup HTTPRequestFactory Implementation based on URLSession

Trikot.http provides its own implementation based on URLSession.

import Trikot
...
HttpConfiguration().httpRequestFactory = TrikotHttpRequestFactory()
Setup connectivity publisher
import Trikot
...
HttpConfiguration().connectivityPublisher = TrikotConnectivityService.shared.publisher
...
TrikotConnectivityService.shared.start() // When app is running
...
TrikotConnectivityService.shared.stop() // When app is in background