參考http://www.javashuo.com/article/p-tgwvgquj-hp.htmlandroid
flutter_boost從0.1.53開始提供了swift demo,但example_swift竟然跑不起來,oc的example能夠。ios
一、 直接把example Flutter下的Debug.xcconfig、Release.xcconfig、AppFrameworkInfo.plist拷過來swift
更新分割線-------------------post
這個blog的集成方法好像沒集成插件- -,不過應該是move腳本有些問題沒把全部framework文件cp過去,繼續參考https://www.kikt.top/posts/flutter/exists/add-flutter-to-ios/?tdsourcetag=s_pctim_aiomsg插件
將四個framework文件都install進來,而後和android同樣調路由和通訊3d
報錯1:Could not cast value of type 'TabbarController' (0x1055dc680) to 'UINavigationController' code
解決:PlatformRouterImp.swiftorm
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裏處理路由邏輯就行路由