admin管理员组

文章数量:1290265

I simply tried to install Hot reloading tool while developing an iOS app.

  1. Installed pod using pod 'InjectHotReload'

  2. Added:

     #if DEBUG
         Bundle(path: "/Applications/InjectionIII.app/Contents/Resources/iOSInjection.bundle")?.load()
     #endif
    

    at the end of didFinishWithLaunching.

  3. Where I instantiate my UIViewController I added an import:

    import InjectHotReload
    

4 ... and then:

        container.register(LoginViewController.self) { resolver in
        let view = InjectConfiguration.ViewHost(resolver.resolve(LoginView.self)!)
        let viewModel = resolver.resolve(LoginViewModelable.self)!
        let router = resolver.resolve(LoginRoutable.self)!
        let controller = resolver.resolve(AccountControllerable.self)!
        let reactiveKeyboard = resolver.resolve(ReactiveKeyboardable.self)!
        return InjectConfiguration.ViewControllerHost(LoginViewController(
            view: view,
            viewModel: viewModel,
            router: router,
            controller: controller,
            reactiveKeyboard: reactiveKeyboard
        ))
    }

And the app on load look like this:

When I change background color:

the app does nothing. After I press back button and then again push controller on the stack, everything works:

What am I doing wrong?

本文标签: iosHot reloading need to push view controller again to see the changes instead of on the flyStack Overflow