     segmentControl.addTarget(self, action: #selector(onSelectedSegmentalChanged), for: .valueChanged)
     segmentControl.sizeToFit()
     navigationItem.titleView = segmentControl
-    for (_,tabVC) in segmentIndexViewControllerMap{
-      putChildControllerIntoContainerView(tabVC)
-    }
     if segmentControl.numberOfSegments > 0 {
       showSegmentTab(index: 0)
     }

  public let segmentControl = UISegmentedControl(frame: .zero)

  public func add(segmentTitle:String,viewController:UIViewController) -> Int{
    let index = segmentControl.numberOfSegments - 1
    segmentIndexViewControllerMap[index] = viewController
    segmentControl.setTitle(segmentTitle, forSegmentAt:index)
    return index
  }


  }

  public func showSegmentTab(index:Int){
    if index == previousSelectedSegmentIndex{
      return
    }
    var oldTabVC:UIViewController?
    if previousSelectedSegmentIndex > -1{
      oldTabVC = segmentIndexViewControllerMap[previousSelectedSegmentIndex]
