So I'm not actually making a Chess app, but I am trying to hook up an engine that uses a protocol almost exactly the same as UCI. I can get it working quite easily on a macOS app. Now, the hard part is integrating an engine like Stockfish into an iOS app.
You can't use std input/output nor can you fork a process, so how should one manage the protocol for communicating moves to a UCI interface? I've managed to include the engine C++ library and can communicate via UCI commands in the debug console but I have no idea how to simulate std input into the engine from iOS. Should I look for hooks within the engine to call directly and simulate the game loop in Swift?
I apologize if this is the wrong community for this question, but UCI specific questions go over the head of most SO users so I thought I might try here. There are a plethora of iOS chess apps so I'm genuinely curious how people are integrating their engines into their apps.