關於 Flutter IOS混合開發打包Framework集成到原生IOS工程 和 flutter_boost使用

參考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;

    }

  報錯2:參考連接,這是一個百度快照,最近簡書抽風了好多文章看不了。http://cache.baiducontent.com/c?m=9d78d513d9d431d94f9a94697d61c0121d4381137d928b4139c3923884125f563164f4ba57356005c4b1787070db5e2aeee736036b5e37b7ea89cf1b87ac925970d571732e4b914163c419dedc4755807cc318feae69bee1b626d4ee8cdc8512158812127bf3ed961f4551dd6f874c6ab0fad812524810cdbc6d3ae21b6a2e9c2111e64dffe7373d05d6&p=882a9140cd904ead1db0c8235152&newp=8b2a97569fd01cff57e9912b515692695d0fc20e38ddd701298ffe0cc4241a1a1a3aecbf22241305d1c47d600ba94b5ce0f730783d0034f1f689df08d2ecce7e3cc13469&user=baidu&fm=sc&query=%BD%E2%BE%F6Swift%D6%D0%B3%F6%CF%D6+No+such+module+%27SnapKit%27&qid=f658b2a60001901a&p1=1blog

 集成:ios的flutter_boost集成比android簡單一些直接在AppDelegate裏初始化,在PlatformRouterImp裏處理路由邏輯就行路由

相關文章
相關標籤/搜索