Hi, I have setup KampKit and started to add my own...
# touchlab-tools
r
Hi, I have setup KampKit and started to add my own request. In Android Studio I can see the changes but when I switch to XCode and run the app, the changes have not propogated. Is there something I need to do in XCode to see the latest code?
r
If you've changed the public API of the shared module, you might need to run
pod install
from the ios folder.
r
No, I replaced the refresh code leaving the signature intact.
I'll try that anyway
that didnt work
is there some clean build/recompile command?
r
You can CMD+SHIFT+K to clean the xcode build folder
r
still no luck, can you explain how the ios project sees the shared lib?
perhaps if i delete it, it may regenerate it?
r
These are the docs on the cocoapods integration https://kotlinlang.org/docs/native-cocoapods.html
Kotlin compiles a binary framework, and wraps it in a podspec that includes a script phase which calls into gradle and builds the kotlin when there are changes
r
so if i change some code in AS, what triggers the script to update the pod?
AS picks up changes instantly (of course)
r
When you do your next build in xcode it should pick up the changes
but it won't pick it up automatically before then
r
so i dont know XCode very well, I know their is a “play” icon and I have been pressing that
r
yeah I would have expected that to do it
r
nothing i have done has changed this
I have deleted the app from the simulator
if i start the simulator and not xcode, can AS deploy to the simulator?
r
yeah you can try the KMM plugin in AS for that
r
ok, i can run it from AS but still not picking up my changes
all i did was change one of the log statements
any ideas? If the iOS project doesnt pick up changes, its going to be a hard sell
could it be versions?
do i have to commit first?
r
Not really sure, sorry. In the middle of a bunch of other things today so I don't have a ton of time to help troubleshoot. You don't need to commit, and versions shouldn't matter. Maybe try a fresh clone of the project and see if that helps
r
Will do, thanks
k
What you're trying to do does generally work fine. If this is still just a test project with nothing private, if you could, push a branch and we'll get somebody to take a look
r
I found the problem
I am changing the BreedViewModel, expecting to see changes in iOS when that class is not used by iOS, the NativeViewModel class is
a bit confused why there are 2 ViewModel classes that have identical Kotlin code
there are some minor diffrences
r
On the Android side it's using the architecture components viewmodel. On the iOS side it needs to replace flows with callbacks that can be passed from Swift.