[Add] configuration closure controller for present style ios 13

This commit is contained in:
Maxim Sorokin 2020-11-11 12:15:39 +03:00
parent d450d5489b
commit 843ee807c4
3 changed files with 9 additions and 0 deletions

View File

@ -29,6 +29,7 @@ public protocol ModalRoutable: Presentable {
func present(_ module: Presentable?)
func present(_ module: Presentable?, animated: Bool)
func present(_ module: Presentable?, configurationClosure: ConfigurationClosure?)
func present(_ module: Presentable?, animated: Bool, configurationClosure: ConfigurationClosure?)
func dismissModule()

View File

@ -44,6 +44,10 @@ public final class ModalRouter: ModalRoutable {
present(module, animated: animated, configurationClosure: nil)
}
public func present(_ module: Presentable?, configurationClosure: ConfigurationClosure?) {
present(module, animated: true, configurationClosure: configurationClosure)
}
public func present(_ module: Presentable?, animated: Bool, configurationClosure: ConfigurationClosure?) {
guard let controller = module?.toPresent() else {
return

View File

@ -129,6 +129,10 @@ open class StackRouter: StackRoutable {
modalRouter?.present(module, animated: animated)
}
public func present(_ module: Presentable?, configurationClosure: ConfigurationClosure?) {
modalRouter?.present(module, animated: true, configurationClosure: configurationClosure)
}
public func present(_ module: Presentable?, animated: Bool, configurationClosure: ConfigurationClosure?) {
modalRouter?.present(module, animated: animated, configurationClosure: configurationClosure)
}