Back to results for “Platform Integration”
.NET MAUI › Native Interop & Libraries

How do you call native iOS (Objective-C/Swift) libraries from MAUI?

Intermediate

Answer

Use a .NET for iOS binding library with ApiDefinition and Structs files describing the native framework, then reference it from Platforms/iOS. Objective-C binds directly; Swift usually needs an Objective-C-compatible interface. Objective Sharpie can generate a starting binding.
var analytics = new Vendor.Analytics();
analytics.TrackEvent("purchase");
Real-world example An iOS-only analytics framework is bound with Objective Sharpie and invoked from iOS platform code.

Common follow-ups: What is Objective Sharpie? | Why do Swift libraries need extra work?