SolidSnake4444
SolidSnake4444

Reputation: 3587

How does one generate an Xcode project or add an iOS extension to a .Net MAUI iOS project?

I know MAUI and .net doesn't directly support app extensions such as Apple Watch or Vision Pro extensions but I would like to add these to my app. I believe for Xamarin, we were able to export as an Xcode project and then load that in Xcode and then code the extension natively to add it on. Is that possible with .net or MAUI so that I can add an Apple Watch or Vision OS extension to my iOS app?

Edit: Found this which is an example of what I'm looking for with combining Xamarin.iOS with a separate Swift component but this is for Xamarin instead of .Net.

https://learn.microsoft.com/en-us/xamarin/ios/platform/ios14/#embedded-widgetkit-support

Upvotes: 2

Views: 997

Answers (1)

micah
micah

Reputation: 1248

If you update the MAUI app to .net9 so you can use xcsync to generate an Xcode project. Here's the docs, https://www.nuget.org/packages/dotnet-xcsync/0.1.0-preview.24509.2

After installing you can open the command pallet in visual studio code (Command + Shift + P) and run xcsync to generate an Xcode project.

From there you should be able to add whatever you need and then use it back in MAUI iOS. Note you will need to use objective c to bridge any SwiftUI code to C# MAUI code.

Upvotes: 0

Related Questions