Closed mattigrthr closed 2 years ago
You definitely shouldn't need to touch simulator, mind recording a video and the code integration snippet you did?
Sure, this is a recording where I change the color of a button. It updates once I click on it.
This is where I injected the snippet:
import SwiftUI
import Inject
struct ContentView: View {
@ObserveInjection var inject
@StateObject var viewRouter = ViewRouter()
@ViewBuilder
var body: some View {
MainContainer(viewRouter: viewRouter).enableInjection()
}
}
Also, I was following this YouTube video and it has the same behaviour: https://youtu.be/kk1DnjyLpUE
@mattigrthr add enableInjection
and ObservedObject
var in each view and you should get proper updates
Jupp, that works. 👍🏽 Thanks for the swift reply @krzysztofzablocki! 🙌🏽
First of all, thanks for open-sourcing this amazing repo. ❤️ A true time-saver!
I got it running but to be able to see the change I have to tap on the simulator. Would be neat to show the result instantly.
I'm guessing enabling the animation is meant for that.
Inject.animation = .interactiveSpring()
But I don't know where to place it. Xcode gives me an error no matter where I place it.
I'm using the
@ObserveInjection var inject
inside myContentView
.My Xcode version is
13.4.1
.