关于 Flutter IOS混合开发打包Framework集成到原生IOS工程 和 flutter_boost使用
参考https://juejin.im/post/5d79af99e51d453c11684ce8
flutter_boost从0.1.53开始提供了swift demo,但example_swift居然跑不起来,oc的example可以。
1、 直接把example Flutter下的Debug.xcconfig、Release.xcconfig、AppFrameworkInfo.plist拷过来
更新分割线-------------------
这个blog的集成方法好像没集成插件- -,不过应该是move脚本有些问题没把所有framework文件cp过去,继续参考https://www.kikt.top/posts/flutter/exists/add-flutter-to-ios/?tdsourcetag=s_pctim_aiomsg
将四个framework文件都install进来,然后和android一样调路由和通信
报错1:Could not cast value of type 'TabbarController' (0x1055dc680) to 'UINavigationController'
解决:PlatformRouterImp.swift
func navigationController() -> UINavigationController { let delegate = UIApplication.shared.delegate as! AppDelegate let navigationController = delegate.window?.rootViewController as! UINavigationController return navigationController; } 改成 func navigationController() -> UINavigationController { let delegate = UIApplication.shared.delegate as! AppDelegate let root = delegate.window?.rootViewController as! TabbarController let navigationController = root.selectedViewController as!UINavigationController return navigationController; }
集成:ios的flutter_boost集成比android简单一些直接在AppDelegate里初始化,在PlatformRouterImp里处理路由逻辑就行