Swiftpack.co - r3tecnologianet/Networking as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by r3tecnologianet.
r3tecnologianet/Networking 0.1.3
Biblioteca de comunicação
⭐️ 0
🕓 23 weeks ago
iOS
.package(url: "https://github.com/r3tecnologianet/Networking.git", from: "0.1.3")

Networking

A description of this package.

let networkService = NetworkService()

guard let url = URL(string: "https://jsonplaceholder.typicode.com/todos/1") else {
    return
}

networkService.request(url: url, method: .get) { (result: Result<Todo, Error>) in
    switch result {
    case .success(let todo):
        print(todo.title)
    case .failure(let error):
        print(error.localizedDescription)
    }
}

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics