diff --git a/src/_assets/image/development/add-to-app/ios/project-setup/embed-xcode.png b/src/_assets/image/development/add-to-app/ios/project-setup/embed-xcode.png index b6d2ae3466..fbdfeade45 100644 Binary files a/src/_assets/image/development/add-to-app/ios/project-setup/embed-xcode.png and b/src/_assets/image/development/add-to-app/ios/project-setup/embed-xcode.png differ diff --git a/src/docs/development/add-to-app/ios/project-setup.md b/src/docs/development/add-to-app/ios/project-setup.md index e71f2b45c1..d4c9fa7abe 100644 --- a/src/docs/development/add-to-app/ios/project-setup.md +++ b/src/docs/development/add-to-app/ios/project-setup.md @@ -81,11 +81,13 @@ The following example assumes that your existing application and the Flutter mod If you have a different directory organization, you may need to adjust the relative paths. ```text -some/path/ - my_flutter/ - .ios/Flutter/podhelper.rb - MyApp/ - Podfile +some/path +├── my_flutter +│ └── .ios +│ └── Flutter +│ └── podhelper.rb +└── MyApp/ + └── Podfile ``` If your existing application (`MyApp`) does not already have a Podfile, follow the @@ -93,21 +95,21 @@ If your existing application (`MyApp`) does not already have a Podfile, follow t 1. Add the following lines to your `Podfile`: - -```ruby - flutter_application_path = '../my_flutter' - load File.join(flutter_application_path, '.ios', 'Flutter', 'podhelper.rb') -``` + + ```ruby + flutter_application_path = '../my_flutter' + load File.join(flutter_application_path, '.ios', 'Flutter', 'podhelper.rb') + ``` 2. For each [Podfile target][] that needs to embed Flutter, call `install_all_flutter_pods(flutter_application_path)`. - -```ruby - target 'MyApp' do - install_all_flutter_pods(flutter_application_path) - end -``` + + ```ruby + target 'MyApp' do + install_all_flutter_pods(flutter_application_path) + end + ``` 3. Run `pod install`. @@ -131,36 +133,36 @@ team cannot locally install Flutter SDK and CocoaPods, or if you do not wish to as a dependency manager in your existing applications. You must run `flutter build ios-framework` every time you make code changes in your Flutter module. -If you are using the above [Embed with CocoaPods and Flutter tools](#embed-with-CocoaPods-and-Flutter-tools) +If you are using the above [Embed with CocoaPods and Flutter tools](#embed-with-cocoapods-and-the-flutter-sdk) method, you can skip these instructions. The following example assumes you want to generate the frameworks to `some/path/MyApp/Flutter/`. -```text -some/path/ - MyApp/ - Flutter/ - Debug/ - Flutter.framework - App.framework - FlutterPluginRegistrant.framework - example_plugin.framework (each plugin with iOS platform code is a separate framework) - Profile/ - Flutter.framework - App.framework - FlutterPluginRegistrant.framework - example_plugin.framework - Release/ - Flutter.framework - App.framework - FlutterPluginRegistrant.framework - example_plugin.framework -``` - ```terminal $ flutter build ios-framework --output=some/path/MyApp/Flutter/ ``` +```text +some/path +├── MyApp +└── Flutter + ├── Debug + │ ├── Flutter.framework + │ ├── App.framework + │ ├── FlutterPluginRegistrant.framework + │ └── example_plugin.framework (each plugin with iOS platform code is a separate framework) + ├── Profile + │ ├── Flutter.framework + │ ├── App.framework + │ ├── FlutterPluginRegistrant.framework + │ └── example_plugin.framework + └── Release + ├── Flutter.framework + ├── App.framework + ├── FlutterPluginRegistrant.framework + └── example_plugin.framework +``` + {{site.alert.tip}} With Xcode 11 installed you can generate [XCFrameworks][] instead of universal frameworks by adding the flags `--xcframework --no-universal`. @@ -170,18 +172,8 @@ Embed the generated frameworks into your existing application in Xcode. For exam drag the frameworks from `some/path/MyApp/Flutter/Release/` in Finder into your targets's build settings > General > Frameworks, Libraries, and Embedded Content. Then, select "Embed & Sign" from the drop-down. -