Fuse Community

"Module not found" Error - Native Interop of Swift Via Objective-C in JS Module

Trying to figure out a “Module not found” error previewing on iPad, yet no errors on the (Windows) desktop. I already searched through this forum looking for answers. I made sure to register the module and run uno clean.

I’m new to native modules and foreign code, trying to get an implementation of Swift working via Objective-C. I’m using Fuse Studio 1.10.0-rc1.

My .uno file:

using Uno;
using Uno.Collections;
using Uno.Compiler.ExportTargetInterop;
using Uno.UX;
using Fuse;
using Fuse.Scripting;
[ForeignInclude(Language.ObjC, "testMod-Swift.h")]

public class testMod : NativeModule
	static readonly testMod _instance;

	public testMod() {
		if(_instance != null) return;

		_instance = this;
		Resource.SetGlobalKey(_instance, "testMod");
		AddMember(new NativeFunction("ViewController", (NativeCallback)ViewController));

	static object ViewController(Context c, object[] args) {
		return null;

	public static extern(!Mobile) void ViewControllerImpl() {
		debug_log("Not supported on this platform.");	

    public static extern(iOS) void ViewControllerImpl()
        ViewController* x = [[ViewController alloc] init];

My MainView.ux file:

			var jsMod = require("testMod");
			function alertTest() {
			module.exports ={
				alertTest : alertTest
		<Button Text="Did it work?" Clicked="{alertTest}" />

My .unoproj file:

  "Packages": [
  "Includes": [