CybercomPoland / viper_templates_swift

Templates of VIPER architecture for Swift language
1 stars 0 forks source link

dismiss() in ModuleStack does not dismiss module's view controller #1

Open AleksanderMaj opened 7 years ago

AleksanderMaj commented 7 years ago

ModuleStack has a dismiss() method:

    func dismiss(animated: Bool, completion: (() -> Void)?) {
        viewController?.presentedViewController?.dismiss(animated: animated, completion: completion)
    }

dismiss() method is supposed to dismiss the module's view controller, right? Then I think accessing presentedViewController is wrong.

ukazsm commented 7 years ago

Yes, you're absolutely right. I have no idea why presentedViewController is accessed. This code should look like this:

    func dismiss(animated: Bool, completion: (() -> Void)?) {
        viewController?.dismiss(animated: animated, completion: completion)
    }