嗨,我在pieChart
切片中遇到了一个segue的问题,segue正常工作,但其标签栏控制器消失了。如果我使用故事板上的按钮转到同一ViewController
,标签栏会正常显示。
Here is my code:
func chartValueSelected(_ chartView: ChartViewBase, entry: ChartDataEntry, highlight: Highlight) {
guard let sliceType = entry.data as? SliceType else {
return
}
switch sliceType {
case .electricity:
let storyboard = UIStoryboard(name: "Main", bundle: Bundle.main)
let addEleController = storyboard.instantiateViewController(withIdentifier: "electricity")
self.navigationController?.pushViewController(addEleController, animated: true)
case .gas:
let storyboard = UIStoryboard(name: "Main", bundle: Bundle.main)
let addEleController = storyboard.instantiateViewController(withIdentifier: "gas")
self.navigationController?.pushViewController(addEleController, animated: true)
case .water:
let storyboard = UIStoryboard(name: "Main", bundle: Bundle.main)
let addEleController = storyboard.instantiateViewController(withIdentifier: "water")
self.navigationController?.pushViewController(addEleController, animated: true)
case .phone:
let storyboard = UIStoryboard(name: "Main", bundle: Bundle.main)
let addEleController = storyboard.instantiateViewController(withIdentifier: "phone")
self.navigationController?.pushViewController(addEleController, animated: true)
case .paytv:
let storyboard = UIStoryboard(name: "Main", bundle: Bundle.main)
let addEleController = storyboard.instantiateViewController(withIdentifier: "paytv")
self.navigationController?.pushViewController(addEleController, animated: true)
addEleController.isKind(of: TabBarController.self)
}
}