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

Cannot emulate VC lifecycle event #685

Open
sssbohdan opened this issue Jul 31, 2020 · 1 comment
Open

Cannot emulate VC lifecycle event #685

sssbohdan opened this issue Jul 31, 2020 · 1 comment

Comments

@sssbohdan
Copy link

Right now it's impossible to trigger lifecycle events from a code for testing. Consider this example:

    let gameViewController = GameViewController(viewModel: .init())
    gameViewController.reactive.lifecycleEvent(.viewDidAppear).observeNext { _ in
      print("called")
    }
    gameViewController.viewDidAppear(true)

Calling viewDidAppear explicitly won't print called

@ibrahimkteish
Copy link
Contributor

have you tried ?

    let gameViewController = GameViewController(viewModel: .init())
    gameViewController.reactive.lifecycleEvent(.viewDidAppear).observeNext { _ in
      print("called")
    }
    gameViewController.loadViewIfNeeded()
    gameViewController.viewDidAppear(true)

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