Is there a way we can integrate .NET MAUI onto existing swift code project

Sam 5 Reputation points
2023-03-23T01:01:48.7966667+00:00

I have an project which was developed in Swift using Xcode. Is there a way we can integrate .NET MAUI on to existing Swift project ?

.NET MAUI
.NET MAUI
A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
2,859 questions
0 comments No comments
{count} vote

3 answers

Sort by: Most helpful
  1. Alessandro Caliaro 4,181 Reputation points
    2023-03-23T05:51:11.36+00:00

    I think the answer is "NO". You have to re-write your project using NET MAUI Framework

    1 person found this answer helpful.
    0 comments No comments

  2. Wenyan Zhang (Shanghai Wicresoft Co,.Ltd.) 26,146 Reputation points Microsoft Vendor
    2023-03-23T06:25:11.0233333+00:00

    Hello,

    Your main purpose is to add the MAUI elements as embedded frameworks to your Swift project, right? MAUI is a cross-platform framework for creating native mobile and desktop apps with C# and XAML, you can invoke the platform code or link the platform library. But you cannot link the MAUI project to your Swift project or make a swift-compliant framework with MAUI.

    There is not an official way to integrate .NET MAUI on to existing Swift project. It's recommended that you create a feature request at https://github.com/dotnet/maui/issues.

    (Some third-party tools can custom bridge to consume Swift with .NET in Xcode because .NET command-line interface can be customized and support for other languages. But I have to say, third-party tools are not supported and recommended on Q&A, you could try to explore whether it can be done.)

    Best Regards,

    Wenyan Zhang


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

  3. Ruffin 0 Reputation points
    2023-09-27T23:38:53.54+00:00

    Interesting Medium post about How to use SwiftUI components in MAUI that looks promising.

    I'm not sure how you'd use command line/pipes on iOS, eg. @Wenyan Zhang (Shanghai Wicresoft Co,.Ltd.) do you have any suggestions?

    0 comments No comments