Closed okla closed 2 years ago
What does the debug console say? Are you watching the correct directory? Did you add an injectionObserver?
Yes, imported Inject, added Observer and called enableInjection(). Console shows correct messages, same as here https://github.com/krzysztofzablocki/Inject#individual-developer-setup-once-per-machine
Very difficult to say what the problem would be. Are you able to zip up the project and post it?
Have you added "Other Linker Flags" "-Xlinker -interposable" to the project?
Yes, flags are added. I will try to prepare a test project tomorrow.
I had today the same problem when I switched from the InjectionIII app installed manually to InjectionIII installed from App Store. Not sure what was the problem. Files were recompiled correctly, but the view was not refreshing. I switched back to the previous version and it works again.
Interesting, this could be something to do with the defaults remembering the selected project. If in doubt, select the project directory again using menu item "Open Project" & I'll have a look at the code. The question is when you save a file do you see the message "Compiling ...", "Injected Type ..." etc.
@johnno1962 I tried with "Open Project" and cleaned up settings, still doesn't work. I noticed this version works more slowly and produces this warning:
Class _TtC10MyModule39MyFile is implemented in both /MyApp/Smth (0x112eb1b58) and /private/var/folders/c3/fn8391xj715ccg2w6bcv8s8w0000gn/T/com.johnholdsworth.InjectionIII/eval101.dylib (0x194ec9010). One of the two will be used. Which one is undefined
I guess that's the problem because I debugged the app and it reloads the view, however the app doesn't see changes.
It's better to use the github version of Injection app @wojciech-kulik because it's newest and @johnno1962 often cuts new updates as we extend the tool, appstore version has longer release cycle
same problem here ... I have created a swiftUI testApp and it doesn't work.
I got error about "-Xlinker -interposable" flags but as you can see on the SS it is added. Any advices ? I use the newest version of Xcode.
@amadeuszpolak does the example app work for you?
@amadeuszpolak, any chance you could zip up your example app and post it here or email it to me: github at johnholdsworth.com. This is bound to be something simple but at a loss to say what it would be.
I have watched the video and the reason was that I added those flags to the Project and not to the target. Now it works ;) thanks guys !
Great news! @okla, could this be your problem?
@johnno1962 Yep, that was the problem, everything works now!
Hurrah!
I have a simple SwiftUI project (2 files), everything is installed and set up, I see all the messages from InjectionIII in console. But changes that I make in views do not appear in simulator.