Last active
August 30, 2019 17:46
-
-
Save AlekseyPleshkov/637c8f6ee3cbddcc9f602c3c259b1aa1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import Foundation | |
| struct NetworkWorker { | |
| // MARK: - Private Properties | |
| private let session = URLSession.shared | |
| // MARK: - Public Methods | |
| /// Глобальный Worker. Отправка запроса к API | |
| /// | |
| /// - Parameters: | |
| /// - to: Ссылка, на которую делать запрос | |
| /// - params: Список параметров ссылки | |
| /// - completion: Возвращает данные или ошибку | |
| func sendRequest(to: URL, params: [String: String], completion: @escaping (Data?, Error?) -> Void) { | |
| // ... | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment