Skip to content

Repository files navigation

NetworkService

While in working

Simple network bicycle:)

Example
DataTaskProcessor().startTask(url:TestRoute.url, method:.get).decode(on:[String:String].self).perform(in:.main).map(\.count).onComplete{ countOfKeys inprint(countOfKeys)}.onError{ error inprint(error)}
or with Publisher
@available(iOS 13,*)
DataTaskProcessor().startTask(url:TestRoute.url, method:.get).publisher
.compactMap(\.data).decode(type:[String:String].self, decoder:JSONDecoder()).sink{ result inswitch result {case.finished:print("Success!")case.failure(let error):print("Error \(error.localizedDescription)")}} receiveValue:{ response inprint(response)}.store(in:&cancellabelEventsContainer)

About

Test network library

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages