R.swift: Support for native dependency injection with storyboard

Created on 17 Oct 2019  路  2Comments  路  Source: mac-cain13/R.swift

iOS 13 introduces native dependency injection for storyboard view controllers. It would be truly awesome to add this feature for R.swift.

More here: https://www.hackingwithswift.com/example-code/uikit/how-to-use-dependency-injection-with-storyboards

Most helpful comment

This would be a nice feature!
I think we should generate an extra function on iOS 13 with a closure as last argument.

Something like this:
R.storyboard.main.userController { coder in .init(coder: coder, user: myUser) }

All 2 comments

This would be a nice feature!
I think we should generate an extra function on iOS 13 with a closure as last argument.

Something like this:
R.storyboard.main.userController { coder in .init(coder: coder, user: myUser) }

Note to self: I just found this branch I created over a year ago: https://github.com/mac-cain13/R.swift/tree/creator

I'm not sure what the state of this is. Maybe this works? Maybe it doesn't...

Was this page helpful?
0 / 5 - 0 ratings