Hi I’d like to make the iOS user interface of my app with swift, so I add in my Xcode project a swift files that inherit ViewController class and I generated also the " - App-Bridging-Header.h" and a xib file to create the gui.
at this point in a file called MainWindow.mm I wrote this code:
If you want to do that, my recommendation is to create a static library project from Projucer, and add that as a subproject to your Swift iOS app. Then you will need to set up your C++ <-> Objective-C bridging so that the C++ methods you need are available in your Swift app. Note that Swift Closures translate to Objective-C Blocks which can be cast to std::function - very handy for callbacks from Swift to C++ or vice versa!
You are really kind! if you can I’d like to se that code!
My initial idea was to istantiate the root View controller in juce and after implement all Gui in swift while the core audio/midi using juce. Starting making a Static library from projucer sounds me more Difficult (maybe only for my inexperience).
Believe me, initially I had a lot of resistance to creating a static library from JUCE and adding it to a project, but it’s a lot less painful than trying to manage your Swift project from Projucer… let JUCE do what its good at and do the rest using the standard tools for creating iOS apps. Then you can use Storyboards etc which you cannot do with a Projucer-created project (AFAIK).
There are a few details to keep in mind, such as header+library search paths - I’ll post something later when I have time…
@adamski sorry to bother you, while we wait for the tutorial can you send me maybe some example code as you said? I’m trying to do some experiments on the subject, but the results are not satisfactory
@adamski - I need this so much as well, how can a mere mortal gain access to your knowledge? I am so tired of trying to figure out how to access audio on iOS and MacOS, as it’s so different (even with Mac Catalyst). I want to use JUCE as an audio access layer (with some JUCE components for configuring it) and then use SceneKit (on Metal) for 3D rendering. I’ve been thinking of how this can be achieved, but no results yet. I’ve made this app with JUCE (https://vsound.app), and I would like to replace the rendering with some complicated 3D stuff. Please help, any pointers?