如何在Flutter(IOS)中更改已启动的故事板

时间:2019-11-14 07:58:27

标签: ios swift xcode flutter storyboard

我正在测试IOS安全套件(快速库),以测试由于缺少防篡改和其他与抖动相关的安全性程序包而在IOS中添加的安全性实现;因此,我需要在本机代码中编写安全功能。

我是个新手(几乎没有使用swift / objective c之类的本机代码开发IOS应用的经验。

我的@objc class AppDelegate: FlutterAppDelegate { override func application( _ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]? ) -> Bool { let isReverseEngineered = IOSSecuritySuite.amIReverseEngineered() ? true : false print("Is Reverse Engineered: " + String(isReverseEngineered)) if(!isReverseEngineered){ let vc = UINavigationController(rootViewController: AppTamperedViewController()) // self.window?.rootViewController = vc self.window?.rootViewController?.present(vc, animated: true); return false } else { GeneratedPluginRegistrant.register(with: self) return super.application(application, didFinishLaunchingWithOptions: launchOptions) } } } 包含以下代码

!isReverseEngineered

通过AppTamperedViewController条件可以使测试变得更容易,因为我只需要显示几乎没有任何功能的页面/故事板。 AppTamperedView正常运行,因为我在其视图控制器上有一些打印日志,该打印日志正在控制台日志中显示。

但是,应用程序仍然会运行/显示默认页面,而不会显示与AppTamperedViewController绑定的!isReverseEngineered

我如何做到这一点,即如果正在运行AppTamperedView条件,那么它应该仅显示models/index.js故事板。否则,应继续使用以flutter编码的默认页面。

0 个答案:

没有答案
相关问题