So, I have been taking part in about with steel C++ on iOS, and would additionally love to do a little bit of taking part in round with swiftUI as properly. I am having a bit of bother seeing the way it will all join up collectively.
I had initially assumed that I might create an MTK::View in C++, and that must be fairly simple to attach as much as swift (i.e. use the C++ view inside the App), however I appear to be incorrect on that assumption. I’ve tried enabling C++/Swift interoperability, Nonetheless if I try to move an MTK::View into swift, e.g.
MTK::View* exportedFunc();
Then swift simply sees that as an OpaquePointer, and I am unable to see a solution to convert that to the swift kind MTKView
. I just about have the identical downside trying to go the opposite manner (e.g. move a tool from swift to C++?)
Is that this a scenario the place you’d nonetheless have to bridge through Goal-C ? (And if that’s the case, are there any easy examples obtainable someplace on how to do that with metalcpp?)
Am I simply going about this all incorrect (and I must be perhaps doing every thing in C++, and name into swift for the UI as a substitute?)
I’ve tried by means of C++/Goal-C inter-op, however nothing appears to work.