Embedding Defold Games in a Swift/UIKit iOS App

Hi,

We’re working on a native iOS app built with Swift and UIKit, and we’re considering adding mini-games using Defold to the app. I have a couple of questions about integrating Defold with our native app:

  1. Defold in UIKit: Is it possible to open a Defold game view within our UIKit-based app? The defold view could be in a separate view controller for example. Something similar to Unity’s “Unity as a Library” feature, where you can embed Unity views in a native app.

  2. Data Sharing: How can we pass data back and forth between the native Swift/UIKit views and Defold views?

Any guidance or pointers towards resources/documentation would be really helpful. Thanks!

I have not heard of anyone embedding a native version of Defold like that. Perhaps you could run the mini-games in a webview instead?

It’s a common practice in Brain Training apps for example, where the home and menu views are in native UIKit and the games are in a cross platform engine.

We’d prefer using defold for iOS instead of web for better responsiveness.

I think it will be easier the other way around. Use Defold as the game engine and main application and then add more views using UIKit. This can probably be achieved using a native extension that acts as the “glue” between the engine and your native views.