将flutter打包成framework放入iOS工程后,可以跳转到flutter页面
一.环境支持
1.Mac.
2.安装有Xcode
3.支持CocoaPods
4.不需要安装flutter依赖环境
二.使用说明
可直接在上述创建的iOSProject中进行添加或重新按下述步骤添加
1.新建iOS工程(swift或oc均可)
2.为工程添加Podfile
3.在工程Podfile中添加:
git:
pod 'MyFlutterPod', :git => 'xxxxxxxx/dflutterframework.git'
本地:
pod 'MyFlutterPod', :path => '../MyFlutterPod'//保证其在同一文件夹,若不是需对其进行调整
4.终端执行:pod install
5.Xcode:buildSetting内bitcode设置为no(release模式必须设置)
6.Xcode—>file—>workspace settings的build system设置为legalBuildsystem(根据环境而定)
7.在Appdelegate中配置代码(参考链接:https://flutter.dev/docs/development/add-to-app/ios/add-flutter-screen?tab=entrypoint-library-swift-tab)
选择模拟器运行即可
有什么问题交流加q:2282901666
网友评论