johnno1962 / injectionforxcode

Runtime Code Injection for Objective-C & Swift
MIT License
6.55k stars 565 forks source link

Automatic "reload" of the current view #80

Closed mhergon closed 8 years ago

mhergon commented 8 years ago

Hi,

Is there any way to reload or "recreate" current view of the app without exiting from an UIViewController?

For example, for now in a UINavigationController I must make changes, inject code, call a "popViewController" method and instantiate the uiviewController again to see changes.

Any idea?

PS: Thanks for the great job.

orta commented 8 years ago

You can use the Injected callbacks to call viewDidLoad again, or move your view creation to another function and let injected call that.

FWIW from my perspective, if you want to guarantee that what you see is exactly what you expect, making the nav change is the best option.

mhergon commented 8 years ago

Thanks @orta

My problem is using framework within existing project. If I starting new project, it would be an option. I will continue investigating about this, but if any has an alternative, please post it.

Thanks!

orta commented 8 years ago

Cool, closing due to inactivity, note, more or less every living object receives the injected call - so they you can do whatever you want when that happens.