參考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里處理路由邏輯就行