Skip to content

πŸ›£ Fast and generic approach for making transitions between the view controllers with injection of dependencies

Notifications You must be signed in to change notification settings

DenisLitvin/GenericRouter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

15 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

GenericRouter

πŸ›£ Fast and generic approach for making transitions between the view controllers with injection of dependencies

Usage

Each view controller needs to conform to Routable. It must provide input and output arrays. Router will check if VC from which you present next VC has output sufficient to provide for next VC's input. For each input you make, the view controller has to have output to match.

class ViewControllerA: Routable {

    var routes: [Route] {
        return [
            Output<String>("Pushed from ViewControllerA")
        ]
    }
    
}
class ViewControllerB: Routable {

    var routes: [Route] {
        return [
            Input<String> { self.nsvigationItem.title = $0 }
        ]
    }
    
}

// ViewControllerB will have nav bar title 'Pushed from ViewControllerA'
Router.push(ViewControllerB(), from:ViewControllerA(), animated:true)

About

πŸ›£ Fast and generic approach for making transitions between the view controllers with injection of dependencies

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages