Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RxController storyboard support #4

Open
brcbydr opened this issue Apr 30, 2020 · 5 comments
Open

RxController storyboard support #4

brcbydr opened this issue Apr 30, 2020 · 5 comments

Comments

@brcbydr
Copy link

brcbydr commented Apr 30, 2020

Sorry for disturbing you but this is really urgent for me.
Unfortunately I have just now seen your suggestion about Snapkit and I already completed the storyboards.

It is very important for me that how can I initialize my viewcontrollers using storyboards? Is it possible?

Please let me know as soon as possible. Thank you so much!

@brcbydr brcbydr changed the title Storyboard and RxController RxController storyboard support Apr 30, 2020
@lm2343635
Copy link
Member

RxViewController and RxViewModel based on generic class, I do not know how to set a class in the storyboard with such a style ViewController<ViewModel>.
Maybe, xib can be supported

@lm2343635
Copy link
Member

Without generic class, it is possible.
Set view model(an IUO property), after initialization of the view controller.

@brcbydr
Copy link
Author

brcbydr commented May 1, 2020

Thanks for your quick return and it is very good to hear that I don't have to give up on RxController. But I couldn't make it:( How can I define viewmodel for viewcontroller without using generic class? And also navigation ? Could you send me a sample code/url or more detail please?

@lm2343635
Copy link
Member

With RxController, using storyboard directly is not allowed.
Maybe, you can fork it and remove the generic class.
Without generic class, you can write as the following

class ViewController {

    private let viewModel: ViewModel!

    override func viewDidLoad() {
         super.viewDidLoad()

        viewModel = ViewModel()
    }

@lm2343635
Copy link
Member

In fact, compared to storyboard, I recommend you to use xib.
You can load the xib in the init method with RxController
With storyboard, the advantages of RxFlow will disappear.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants