How to Integrate Flutter into an Existing iOS App (Step-by-Step Guide)

How to Integrate Flutter into an Existing iOS App (Step-by-Step Guide)

Image
Integrating Flutter to an Existing iOS Native App
2 m

Integrating Flutter into an Existing iOS Native App

Integrating Flutter into an existing iOS native app is a powerful way to add new features without rewriting your entire codebase. One of the cleanest approaches is packaging your Flutter module as an iOS framework and embedding it in your native project.

In this step-by-step guide, you’ll learn exactly how to integrate Flutter into your existing iOS app.

Integrating Flutter into an Existing iOS Native App

✨ Benefits of Adding Flutter into an Existing iOS App

  • Faster Feature Development: Add new features without rewriting existing native code.
  • Cross-Platform Compatibility: Reuse the Flutter module for Android.
  • Access to Flutter Ecosystem: Use thousands of Flutter packages and plugins.
  • Incremental Migration: Gradually migrate parts of your app while keeping stable native code.

📝 Use Case

Maintaining a large native iOS app can be challenging, and rewriting it from scratch is often risky. By integrating Flutter, you can keep your existing native code and start adding new features in Flutter. This approach lets you enhance your app, use Flutter’s UI components and packages, and gradually modernize it without breaking your current app or losing the work you’ve already done.


1. Create the Flutter Module

From the command line:

flutter create --template module flutter_module

This creates a reusable Flutter module with the following structure:

flutter_module/
  .android/
  .ios/
  lib/
  pubspec.yaml

2. Build the Flutter iOS Framework

cd flutter_module
flutter build ios-framework --output=/path/to/MyApp/Flutter/

💡 Run this command every time you change code in your Flutter module.

The output folder should look like this:

/path/to/MyApp/
└── Flutter/
    ├── Debug/
    │   ├── Flutter.xcframework
    │   ├── App.xcframework
    │   ├── FlutterPluginRegistrant.xcframework
    │   └── example_plugin.xcframework
    ├── Profile/
    │   ├── Flutter.xcframework
    │   ├── App.xcframework
    │   ├── FlutterPluginRegistrant.xcframework
    │   └── example_plugin.xcframework
    └── Release/
        ├── Flutter.xcframework
        ├── App.xcframework
        ├── FlutterPluginRegistrant.xcframework
        └── example_plugin.xcframework

3. Link All Frameworks in Xcode

  1. Open your iOS project in Xcode.
  2. Go to Build Phases → Link Binary With Libraries.
  3. Click +Add Other… → Add Files…
  4. Navigate to: /path/to/MyApp/Flutter/Release/
  5. Select all .xcframework files (⌘ + click) and press Open

4. Make Framework Paths Dynamic

Ensure Xcode loads the correct framework for each build mode (Debug / Profile / Release).

  1. In Finder, open: /path/to/MyApp
  2. Right-click MyApp.xcodeprojShow Package Contents
  3. Open project.pbxproj in Xcode
  4. Find entries like: path = Flutter/Release/Flutter.xcframework;
  5. Update the path to: "Flutter/$(CONFIGURATION)/Flutter.xcframework"

Important: Include the double quotes exactly as shown. Missing quotes will cause build errors.

💡 Repeat this step for all frameworks.


5. Update Framework Search Paths

In Xcode:

  • Go to Build Settings → Framework Search Paths
  • Add: $(PROJECT_DIR)/Flutter/$(CONFIGURATION)/

6. Embed the Dynamic Frameworks

  1. Go to General → Frameworks, Libraries, and Embedded Content
  2. For each dynamic Flutter framework, set Embed & Sign
  3. Verify under Build Phases → Embed Frameworks that only dynamic frameworks are listed

⚠️ Do not embed static frameworks (e.g., FlutterPluginRegistrant.xcframework)


7. Build the Project

  1. Open MyApp.xcworkspace in Xcode
  2. Select Product → Build or press Cmd + B

✅ Conclusion

Integrating Flutter into an existing iOS app allows you to modernize your application without starting from scratch. You can continue using your native code while taking advantage of Flutter’s fast development, flexible UI system, and cross-platform capabilities. By gradually building new features in Flutter, you gain both stability and speed, reducing development risk and saving time.


📚 References

 

Looking For Professional App development Services?

Our innovative approach blends aesthetics and functionality, creating bespoke online experiences that resonate. We tailor every pixel to showcase your uniqueness. 

Coders Employee
Dana Asfour
Mobile Applications Developer
I am a dedicated Flutter developer with a passion for building mobile applications that offer exceptional user experiences. Focused on learning and improving, I strive to create efficient, high-quality solutions with clean, maintainable code.

Share

LinkedInFacebookX-Twitter

Stay Updated! 

Keep me updated about new technologies, design trends, business solutions and special offers.

By subscribing to this newsletter, you agree to receive emails and allow your email to be stored