接上篇 https://www.jianshu.com/p/329120e0544a
上一篇写到如何把flutter集成到iOS原项目中,本文介绍pod更简单的接入flutter
01可在任一项目中, 修改Podfile文件引入Flutter模块
pod 'DATKFlutterSDK', :git => 'git@git.xxx.xxx.com/XXXFlutterSDK.git', :tag => '1.0.0'
#git@git.xxx.xxx.com/XXXFlutterSDK.git为您的pod远端地址
这样就集成完毕啦,是不是很简单
02如何跳转
//在控制器中, 先导入 GeneratedPluginRegistrant
//#import <DATKFlutterSDK/GeneratedPluginRegistrant.h>
//然后就可以直接嗨拉~
FlutterViewController* flutterViewController = [[FlutterViewController alloc] init];
[GeneratedPluginRegistrant registerWithRegistry:flutterViewController];//注册插件
[self.navigationController pushViewController:flutterViewController animated:YES];
03瘦身:集成Flutter后,ipa包会+15M,安装后占用+44M;
使用下面链接的方法可以使ipa包缩减至+5.4M,安装后占用缩减至+14.5M;
https://www.jianshu.com/p/b16ff23363c0
网友评论