From 356263a095d935c30602d381b5fe88873512d462 Mon Sep 17 00:00:00 2001 From: Maksim Ivanov Date: Mon, 1 May 2023 10:47:11 +0300 Subject: [PATCH] release-2.1.0 --- Source/Builder.swift | 14 ++++++++++++++ Source/Networking/HttpClient.swift | 2 +- Source/Router.swift | 7 +++++++ 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/Source/Builder.swift b/Source/Builder.swift index fa90048..2e9d3d0 100644 --- a/Source/Builder.swift +++ b/Source/Builder.swift @@ -12,11 +12,25 @@ public protocol ViewBuilder { func build() -> UIView } +public protocol ParametrizedViewBuilder { + + associatedtype Parameter + + func build(_ parameter: Parameter) -> UIView +} + public protocol ViewControllerBuilder { func build() -> UIViewController } +public protocol ParametrizedViewControllerBuilder { + + associatedtype Parameter + + func build(_ parameter: Parameter) -> UIViewController +} + public protocol SearchControllerBuilder { func build() -> UISearchController diff --git a/Source/Networking/HttpClient.swift b/Source/Networking/HttpClient.swift index c7f378b..1f6fea9 100644 --- a/Source/Networking/HttpClient.swift +++ b/Source/Networking/HttpClient.swift @@ -17,7 +17,7 @@ public struct Http { public let body: Data? public init(urlString: String = "", - method: String = "", + method: String = "GET", headers: [String: String]? = nil, body: Data? = nil) { self.urlString = urlString diff --git a/Source/Router.swift b/Source/Router.swift index b919d80..75b9fcb 100644 --- a/Source/Router.swift +++ b/Source/Router.swift @@ -9,3 +9,10 @@ public protocol Router { func navigate() } + +public protocol ParametrizedRouter { + + associatedtype Parameter + + func navigate(_ parameter: Parameter) +}