Thursday, November 23, 2023
HomeiOS Developmentios - Embed FlutterViewController to Native Swift TabBar

ios – Embed FlutterViewController to Native Swift TabBar


I’ve a local iOS app written by Swift. I embedded one other Flutter app into the native iOS app as a framework. Once I searched everybody initialized FlutterViewController inside a local iOS ViewController.

BUT, I wish to embed FlutterViewController to TabBar. When a chosen tab is clicked the FlutterViewController needs to be pushed.

Once I attempt to do this like this, the TabBar structure is breaking down. Even when there are solely 5 tabs it turns into extra kind.

enter image description here

Additionally, I’ve an error message too.

Thread 1: "Inconsistency in UITabBar objects and examine controllers detected. No view controller matches the UITabBarItem '<UITabBarItem: 0x114e4a6a0> title="Order" picture=<UIImage:0x6000030241b0 nameless {24, 24} renderingMode=alwaysOriginal> chosen'."

I’m initiating the VC like this.

  lazy var orderController: FlutterViewController = {
    let controller = Order2ViewController(engine: AppDelegate.shared.flutterEngine, nibName: nil, bundle: nil)
    controller.tabBarItem = TabBarItem.order
    return controller
  }()

How may I embed a FlutterVC to native Swift TabBar? Or should not I do it. I do not know one of the best follow?

I’m anticipating to determine embed a FlutterVC to native Swift TabBar.



Supply hyperlink

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments